mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Build: Unify setting _BUILD_DIRECTIVE preprocessor macro for all compilers
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$<CONFIG>")
|
||||
|
||||
set(CLANG_EXPECTED_VERSION 11.0.0)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
|
||||
# apple doesnt like to do the sane thing which would be to use the same version numbering as regular clang
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$<CONFIG>")
|
||||
|
||||
set(GCC_EXPECTED_VERSION 11.1.0)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
|
||||
|
||||
@@ -59,23 +59,13 @@ else()
|
||||
message(STATUS "MSVC: Disabled Safe Exception Handlers for debug builds")
|
||||
endif()
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
# msbuild/devenv don't set CMAKE_MAKE_PROGRAM, you can choose build type from a dropdown after generating projects
|
||||
if("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$(ConfigurationName)")
|
||||
|
||||
# multithreaded compiling on VS
|
||||
target_compile_options(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
/MP)
|
||||
else()
|
||||
# while all make-like generators do (nmake, ninja)
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$<CONFIG>")
|
||||
|
||||
# Forces writes to the PDB file to be serialized through mspdbsrv.exe (/FS)
|
||||
# Enable faster PDB generation in parallel builds by minimizing RPC calls to mspdbsrv.exe (/Zf)
|
||||
target_compile_options(trinity-compile-option-interface
|
||||
|
||||
@@ -15,6 +15,11 @@ add_library(trinity-compile-option-interface INTERFACE)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$<CONFIG>")
|
||||
|
||||
# An interface library to make the target features available to other targets
|
||||
add_library(trinity-feature-interface INTERFACE)
|
||||
|
||||
|
||||
@@ -52,8 +52,4 @@ elseif(CMAKE_C_COMPILER MATCHES "icc")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/icc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
|
||||
else()
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user