diff options
author | Naios <naios-dev@live.de> | 2017-10-31 01:29:51 +0100 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2017-12-20 04:04:27 +0100 |
commit | ff35262a3ac804db7a941f29040e4b299a7cb7c4 (patch) | |
tree | fe05ea8b57ab71056a6e800a00213fbab8a066c7 /dep | |
parent | af7352118b6e7306a8d8a28934ee62f27886808e (diff) |
Build: Use interface targets for inheriting flags and definitions
* Remove the usage of global flags and definitions
set through the CMAKE_CXX_FLAGS variable.
* Use cmake target compile features for setting the
CXX standard automatically.
* Make C++14 globally available in the project
* Closes #21033
(cherry picked from commit e60c1f84a7e13577a82046b02b214f9466d20a7c)
Diffstat (limited to 'dep')
-rw-r--r-- | dep/CMakeLists.txt | 8 | ||||
-rw-r--r-- | dep/CascLib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/bzip2/CMakeLists.txt | 4 | ||||
-rw-r--r-- | dep/efsw/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/fmt/CMakeLists.txt | 4 | ||||
-rw-r--r-- | dep/g3dlite/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/gsoap/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/jemalloc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/protobuf/CMakeLists.txt | 9 | ||||
-rw-r--r-- | dep/recastnavigation/Detour/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/recastnavigation/Recast/CMakeLists.txt | 2 | ||||
-rw-r--r-- | dep/zlib/CMakeLists.txt | 4 |
12 files changed, 28 insertions, 15 deletions
diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index a3f95cb221e..6e3434ef777 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -8,14 +8,6 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - string(REGEX REPLACE "/W[0-4] " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REGEX REPLACE "/W[0-4] " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - add_definitions(/W0) -else() - add_definitions(-w) -endif() - add_subdirectory(threads) if(SERVERS OR TOOLS) diff --git a/dep/CascLib/CMakeLists.txt b/dep/CascLib/CMakeLists.txt index a649d33016a..0efe93771f1 100644 --- a/dep/CascLib/CMakeLists.txt +++ b/dep/CascLib/CMakeLists.txt @@ -54,6 +54,8 @@ target_include_directories(casc ${CMAKE_SOURCE_DIR}/dep) target_link_libraries(casc + PRIVATE + trinity-dependency-interface PUBLIC zlib) diff --git a/dep/bzip2/CMakeLists.txt b/dep/bzip2/CMakeLists.txt index ad3d92933c4..22a3d522c04 100644 --- a/dep/bzip2/CMakeLists.txt +++ b/dep/bzip2/CMakeLists.txt @@ -30,6 +30,10 @@ else() PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(bzip2 + PRIVATE + trinity-dependency-interface) + set_target_properties(bzip2 PROPERTIES FOLDER diff --git a/dep/efsw/CMakeLists.txt b/dep/efsw/CMakeLists.txt index f268558a527..b37e5021e0a 100644 --- a/dep/efsw/CMakeLists.txt +++ b/dep/efsw/CMakeLists.txt @@ -73,6 +73,8 @@ if (BUILD_SHARED_LIBS) ${CMAKE_CURRENT_SOURCE_DIR}/src) target_link_libraries(efsw + PRIVATE + trinity-dependency-interface PUBLIC threads ${OPTIONAL_MAC_LINK_LIBRARIES}) diff --git a/dep/fmt/CMakeLists.txt b/dep/fmt/CMakeLists.txt index 2961a0fc139..c764135e607 100644 --- a/dep/fmt/CMakeLists.txt +++ b/dep/fmt/CMakeLists.txt @@ -46,6 +46,10 @@ target_compile_definitions(fmt -DFMT_USE_DELETED_FUNCTIONS -DFMT_USE_EXTERN_TEMPLATES) +target_link_libraries(fmt + PRIVATE + trinity-dependency-interface) + set_target_properties(fmt PROPERTIES FOLDER diff --git a/dep/g3dlite/CMakeLists.txt b/dep/g3dlite/CMakeLists.txt index 6409993a0b1..91eff29c6cb 100644 --- a/dep/g3dlite/CMakeLists.txt +++ b/dep/g3dlite/CMakeLists.txt @@ -61,6 +61,8 @@ target_include_directories(g3dlib ${CMAKE_CURRENT_SOURCE_DIR}/include) target_link_libraries(g3dlib + PRIVATE + trinity-dependency-interface PUBLIC zlib threads) diff --git a/dep/gsoap/CMakeLists.txt b/dep/gsoap/CMakeLists.txt index 19634334b4f..a4c84159e94 100644 --- a/dep/gsoap/CMakeLists.txt +++ b/dep/gsoap/CMakeLists.txt @@ -23,6 +23,8 @@ target_compile_definitions(gsoap -DWITH_OPENSSL) target_link_libraries(gsoap + PRIVATE + trinity-dependency-interface PUBLIC openssl) diff --git a/dep/jemalloc/CMakeLists.txt b/dep/jemalloc/CMakeLists.txt index 7c2e494c52a..3be16543209 100644 --- a/dep/jemalloc/CMakeLists.txt +++ b/dep/jemalloc/CMakeLists.txt @@ -66,6 +66,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM) -D_REENTRAN) target_link_libraries(jemalloc + PRIVATE + trinity-dependency-interface PUBLIC threads valgrind) diff --git a/dep/protobuf/CMakeLists.txt b/dep/protobuf/CMakeLists.txt index c6aad4bf631..c4b5d83f45e 100644 --- a/dep/protobuf/CMakeLists.txt +++ b/dep/protobuf/CMakeLists.txt @@ -57,13 +57,6 @@ else() ) endif() -if (UNIX) - # Enable the default unix export behaviour for protobuf so we don't - # need to patch it's sources. - string(REPLACE "-fvisibility=hidden" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -endif() - add_library(protobuf ${protobuf_STAT_SRCS}) target_include_directories(protobuf @@ -73,6 +66,8 @@ target_include_directories(protobuf ${CMAKE_CURRENT_SOURCE_DIR}/tc_custom) target_link_libraries(protobuf + PRIVATE + trinity-default-interface PUBLIC threads) diff --git a/dep/recastnavigation/Detour/CMakeLists.txt b/dep/recastnavigation/Detour/CMakeLists.txt index 0fed4afc7ec..8b729167109 100644 --- a/dep/recastnavigation/Detour/CMakeLists.txt +++ b/dep/recastnavigation/Detour/CMakeLists.txt @@ -24,6 +24,8 @@ target_include_directories(Detour ${CMAKE_CURRENT_SOURCE_DIR}/Include) target_link_libraries(Detour + PRIVATE + trinity-dependency-interface PUBLIC zlib) diff --git a/dep/recastnavigation/Recast/CMakeLists.txt b/dep/recastnavigation/Recast/CMakeLists.txt index e83636a76f2..914342031cc 100644 --- a/dep/recastnavigation/Recast/CMakeLists.txt +++ b/dep/recastnavigation/Recast/CMakeLists.txt @@ -28,6 +28,8 @@ target_include_directories(Recast ${CMAKE_CURRENT_SOURCE_DIR}/Include) target_link_libraries(Recast + PRIVATE + trinity-dependency-interface PUBLIC zlib) diff --git a/dep/zlib/CMakeLists.txt b/dep/zlib/CMakeLists.txt index 77352d81c82..623f6b7183e 100644 --- a/dep/zlib/CMakeLists.txt +++ b/dep/zlib/CMakeLists.txt @@ -43,6 +43,10 @@ else() PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(zlib + PRIVATE + trinity-dependency-interface) + set_target_properties(zlib PROPERTIES FOLDER |