Build system: Support new in cmake 3.17 Ninja Multi-Config generator

This commit is contained in:
Shauren
2020-04-16 17:53:36 +02:00
parent 01c68b2aa2
commit 369b618d4f
6 changed files with 9 additions and 6 deletions

View File

@@ -40,7 +40,10 @@ list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/dep/cotire/CMake")
# build in Release-mode by default if not explicitly set
if( NOT CMAKE_BUILD_TYPE )
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
set(CMAKE_DEFAULT_BUILD_TYPE "RelWithDebInfo" CACHE INTERNAL "")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

View File

@@ -1,7 +1,7 @@
# Set build-directive (used in core to tell which buildtype we used)
target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
-D_BUILD_DIRECTIVE="$<CONFIG>")
if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface

View File

@@ -1,7 +1,7 @@
# Set build-directive (used in core to tell which buildtype we used)
target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
-D_BUILD_DIRECTIVE="$<CONFIG>")
set(GCC_EXPECTED_VERSION 6.3.0)

View File

@@ -1,6 +1,6 @@
target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
-D_BUILD_DIRECTIVE="$<CONFIG>")
if(PLATFORM EQUAL 32)
target_compile_options(trinity-compile-option-interface

View File

@@ -4,7 +4,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Set build-directive (used in core to tell which buildtype we used)
target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
-D_BUILD_DIRECTIVE="$<CONFIG>")
if(PLATFORM EQUAL 32)
# Required on 32-bit systems to enable SSE2 (standard on x64)

View File

@@ -59,7 +59,7 @@ else()
# while all make-like generators do (nmake, ninja)
target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
-D_BUILD_DIRECTIVE="$<CONFIG>")
endif()
# multithreaded compiling on VS