mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-23 03:58:59 +00:00
Merge pull request #235 from Lgt2x/cmake-options
CMake: expose BUILD_TESTNG option, rename LOGGER to ENABLE_LOGGER
This commit is contained in:
commit
ae03b6fd02
@ -11,7 +11,8 @@ project(Descent3
|
||||
)
|
||||
|
||||
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with ninja)." OFF)
|
||||
option(LOGGER "Enable logging to the terminal" OFF)
|
||||
option(ENABLE_LOGGER "Enable logging to the terminal" OFF)
|
||||
option(BUILD_TESTING "Enable testing. Requires GTest." OFF)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@ -25,9 +26,9 @@ if(FORCE_COLORED_OUTPUT)
|
||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options (-fdiagnostics-color=always)
|
||||
add_compile_options(-fdiagnostics-color=always)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options (-fcolor-diagnostics)
|
||||
add_compile_options(-fcolor-diagnostics)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -136,7 +137,7 @@ add_compile_definitions($<$<CONFIG:Debug>:_DEBUG>)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
if(LOGGER)
|
||||
if(ENABLE_LOGGER)
|
||||
message("Enabling Logging")
|
||||
add_compile_definitions(LOGGER)
|
||||
endif()
|
||||
|
@ -37,14 +37,14 @@ setx PATH=%VCPKG_ROOT%;%PATH%
|
||||
|
||||
Build Descent 3:
|
||||
```sh
|
||||
cmake --preset win -D LOGGER=[ON|OFF]
|
||||
cmake --preset win -D ENABLE_LOGGER=[ON|OFF]
|
||||
cmake --build --preset win --config [Debug|Release]
|
||||
```
|
||||
|
||||
#### Building - MacOS
|
||||
```sh
|
||||
brew bundle install
|
||||
cmake --preset mac -D LOGGER=[ON|OFF]
|
||||
cmake --preset mac -D ENABLE_LOGGER=[ON|OFF]
|
||||
cmake --build --preset mac --config [Debug|Release]
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user