From c12f669fc5050017d98ec57c8a45e575154a5edb Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 15 Jul 2024 15:24:35 +0200 Subject: 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) --- src/common/CMakeLists.txt | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/common') diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 66caf6c4e10..ba27ddee3e2 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -29,21 +29,10 @@ endif(USE_COREPCH) GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DTRINITY_API_EXPORT_COMMON) - add_library(common ${PRIVATE_SOURCES} ) -# Do NOT add any extra include directory here, as we don't want the common -# library to depend on anything else than TC deps, and itself. -# This way we ensure that if either a PR does that without modifying this file, -# a compile error will be generated, either this file will be modified so it -# is detected more easily. -# While it is OK to include files from other libs as long as they don't require -# linkage (enums, defines...) it is discouraged to do so unless necessary, as it will pullute -# include_directories leading to further unnoticed dependency aditions -# Linker Depencency requirements: none CollectIncludeDirectories( ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC_INCLUDES @@ -58,6 +47,10 @@ target_include_directories(common PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_compile_definitions(common + PRIVATE + TRINITY_API_EXPORT_COMMON) + target_link_libraries(common PRIVATE trinity-core-interface -- cgit v1.2.3