Renamed some preproc vars and some CMake/build dir cleanup
This commit is contained in:
parent
3b828a34ff
commit
4c8c622f0b
@ -5,15 +5,11 @@ cmake_policy(SET CMP0135 NEW)
|
|||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
message(STATUS "Targeting Release build")
|
message(STATUS "Targeting Release build")
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./release)
|
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ./release)
|
|
||||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
message(STATUS "Targeting Debug build")
|
message(STATUS "Targeting Debug build")
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./debug)
|
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ./debug)
|
|
||||||
set(NB_LOGGING ON)
|
set(NB_LOGGING ON)
|
||||||
set(NB_BUILD_TESTS ON)
|
set(NB_BUILD_TESTS ON)
|
||||||
add_compile_definitions(_NB_DEBUG)
|
add_compile_definitions(_NB_BUILD_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
@ -36,6 +32,7 @@ set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|||||||
if(NB_BUILD_TESTS)
|
if(NB_BUILD_TESTS)
|
||||||
message(STATUS "Building tests")
|
message(STATUS "Building tests")
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
gtest
|
gtest
|
||||||
@ -51,13 +48,13 @@ endif()
|
|||||||
|
|
||||||
if (NB_LOGGING)
|
if (NB_LOGGING)
|
||||||
message(STATUS "Building with automatic logging")
|
message(STATUS "Building with automatic logging")
|
||||||
add_compile_definitions(_NB_AUTO_LOG)
|
add_compile_definitions(_NB_AUTOLOG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NB_TARGET_WINDOWS)
|
if (NB_TARGET_WINDOWS)
|
||||||
add_compile_definitions(_TARGET_WINDOWS)
|
add_compile_definitions(_NB_TARGET_WINDOWS)
|
||||||
elseif (NB_TARGET_LINUX)
|
elseif (NB_TARGET_LINUX)
|
||||||
add_compile_definitions(_TARGET_LINUX)
|
add_compile_definitions(_NB_TARGET_LINUX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(./engine)
|
add_subdirectory(./engine)
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
#ifdef _TARGET_WINDOWS
|
#ifdef _NB_TARGET_WINDOWS
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#endif // _TARGET_WINDOWS
|
#endif // _NB_TARGET_WINDOWS
|
||||||
|
|
||||||
#ifdef _TARGET_LINUX
|
#ifdef _NB_TARGET_LINUX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif // _TARGET_LINUX
|
#endif // _NB_TARGET_LINUX
|
||||||
|
|
||||||
#include "Processes.hpp"
|
#include "Processes.hpp"
|
||||||
#include "Types.hpp"
|
#include "Types.hpp"
|
||||||
|
|
||||||
namespace nb {
|
namespace nb {
|
||||||
|
|
||||||
#ifdef _TARGET_WINDOWS
|
#ifdef _NB_TARGET_WINDOWS
|
||||||
uint64_t GetPID() {
|
uint64_t GetPID() {
|
||||||
return GetCurrentProcessId();
|
return GetCurrentProcessId();
|
||||||
}
|
}
|
||||||
#endif // _TARGET_WINDOWS
|
#endif // _NB_TARGET_WINDOWS
|
||||||
|
|
||||||
#ifdef _TARGET_LINUX
|
#ifdef _NB_TARGET_LINUX
|
||||||
#endif // _TARGET_LINUX
|
#endif // _NB_TARGET_LINUX
|
||||||
|
|
||||||
} // namespace nb
|
} // namespace nb
|
||||||
@ -9,14 +9,3 @@
|
|||||||
TEST(ProcessesTest, GetPID) {
|
TEST(ProcessesTest, GetPID) {
|
||||||
ASSERT_EQ(nb::GetPID(), GetCurrentProcessId());
|
ASSERT_EQ(nb::GetPID(), GetCurrentProcessId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* int main() {
|
|
||||||
|
|
||||||
std::cout << "nb::GetPID() -> " << nb::GetPID() << std::endl;
|
|
||||||
|
|
||||||
#ifdef _TARGET_WINDOWS
|
|
||||||
std::cout << "GetCurrentProcessId() -> " << GetCurrentProcessId() << std::endl;
|
|
||||||
#endif // _TARGET_WINDOWS
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} */
|
|
||||||
Loading…
x
Reference in New Issue
Block a user