diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-15 15:24:35 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-18 22:34:00 +0200 |
commit | c12f669fc5050017d98ec57c8a45e575154a5edb (patch) | |
tree | a735717a956aca535812b29d8d2fd4f80e72a851 /cmake/compiler | |
parent | 5e3a42ee8251ec0495ad42b57db728363bf7b844 (diff) |
Build: CMake cleanup
* Migrate all add_definitions to target_compile_definitions
* Remove -D from preprocessor definitions added by target_compile_definitions (unneccessary, cmake strips it anyway)
* Fixed NO_BUFFERPOOL not being set on g3d if jemalloc is used
* Moved library/compiler specific compile flag settings spread all over various CMakeLists to their related library/compiler file
* Remove ancient manual link flag settings for worldserver
(cherry picked from commit 77fe2745febab9e4362b09750093d831325e6091)
Diffstat (limited to 'cmake/compiler')
-rw-r--r-- | cmake/compiler/clang/settings.cmake | 2 | ||||
-rw-r--r-- | cmake/compiler/gcc/settings.cmake | 8 | ||||
-rw-r--r-- | cmake/compiler/icc/settings.cmake | 4 | ||||
-rw-r--r-- | cmake/compiler/msvc/settings.cmake | 14 |
4 files changed, 14 insertions, 14 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake index 1ff7fcb2422..235a2618e2f 100644 --- a/cmake/compiler/clang/settings.cmake +++ b/cmake/compiler/clang/settings.cmake @@ -35,7 +35,7 @@ if (NOT CLANG_HAVE_PROPER_CHARCONV) message(STATUS "Clang: Detected from_chars bug for 64-bit integers, workaround enabled") target_compile_definitions(trinity-compile-option-interface INTERFACE - -DTRINITY_NEED_CHARCONV_WORKAROUND) + TRINITY_NEED_CHARCONV_WORKAROUND) endif() if(WITH_WARNINGS) diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index e830d28b655..3806ffee984 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -6,6 +6,10 @@ else() message(STATUS "GCC: Minimum version required is ${GCC_EXPECTED_VERSION}, found ${CMAKE_CXX_COMPILER_VERSION} - ok!") endif() +target_compile_options(trinity-compile-option-interface + INTERFACE + -fno-delete-null-pointer-checks) + if(PLATFORM EQUAL 32) # Required on 32-bit systems to enable SSE2 (standard on x64) target_compile_options(trinity-compile-option-interface @@ -16,8 +20,8 @@ endif() if(TRINITY_SYSTEM_PROCESSOR MATCHES "x86|amd64") target_compile_definitions(trinity-compile-option-interface INTERFACE - -DHAVE_SSE2 - -D__SSE2__) + HAVE_SSE2 + __SSE2__) message(STATUS "GCC: SFMT enabled, SSE2 flags forced") endif() diff --git a/cmake/compiler/icc/settings.cmake b/cmake/compiler/icc/settings.cmake index 87187cc3a5c..a17e2c45d2a 100644 --- a/cmake/compiler/icc/settings.cmake +++ b/cmake/compiler/icc/settings.cmake @@ -1,7 +1,3 @@ -target_compile_definitions(trinity-compile-option-interface - INTERFACE - -D_BUILD_DIRECTIVE="$<CONFIG>") - if(PLATFORM EQUAL 32) target_compile_options(trinity-compile-option-interface INTERFACE diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index b7f67874329..50dac95f123 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -34,7 +34,7 @@ if(PLATFORM EQUAL 64) # debugger functionality. target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_WIN64) + _WIN64) message(STATUS "MSVC: 64-bit platform, enforced -D_WIN64 parameter") @@ -88,24 +88,24 @@ endif() # Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES) + _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES) message(STATUS "MSVC: Overloaded standard names") # Ignore warnings about older, less secure functions target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_CRT_SECURE_NO_WARNINGS) + _CRT_SECURE_NO_WARNINGS) message(STATUS "MSVC: Disabled NON-SECURE warnings") # Ignore warnings about POSIX deprecation target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_CRT_NONSTDC_NO_WARNINGS) + _CRT_NONSTDC_NO_WARNINGS) # Force math constants like M_PI to be available target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_USE_MATH_DEFINES) + _USE_MATH_DEFINES) message(STATUS "MSVC: Disabled POSIX warnings") @@ -157,8 +157,8 @@ target_compile_options(trinity-compile-option-interface if(ASAN) target_compile_definitions(trinity-compile-option-interface INTERFACE - -D_DISABLE_STRING_ANNOTATION - -D_DISABLE_VECTOR_ANNOTATION) + _DISABLE_STRING_ANNOTATION + _DISABLE_VECTOR_ANNOTATION) target_compile_options(trinity-compile-option-interface INTERFACE |