feat(Cmake/Build): Use interface targets for inheriting flags and definitions (#2255)

Co-authored-by: Naios Naios@users.noreply.github.com
This commit is contained in:
Kargatum
2019-09-18 20:04:48 +07:00
committed by GitHub
parent 91d62373cc
commit 0e6c9a18f4
20 changed files with 291 additions and 72 deletions

10
deps/CMakeLists.txt vendored
View File

@@ -1,3 +1,4 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
#
# This file is free software; as a special exception the author gives
@@ -7,14 +8,7 @@
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
if( 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()
#
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if(USE_MYSQL_SOURCES)

View File

@@ -348,6 +348,10 @@ if (MINGW) # GCC ignores "#prama comment"
target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock)
endif()
target_link_libraries(ace
PRIVATE
acore-dependency-interface)
# Generate precompiled header
if(USE_COREPCH)
add_cxx_pch(ace ${PRIVATE_PCH_HEADER})

View File

@@ -33,6 +33,10 @@ else()
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(bzip2
PRIVATE
acore-dependency-interface)
set_target_properties(bzip2
PROPERTIES
FOLDER

View File

@@ -67,6 +67,10 @@ target_include_directories(fmt
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(fmt
PRIVATE
acore-dependency-interface)
set_target_properties(fmt
PROPERTIES
FOLDER

View File

@@ -63,6 +63,8 @@ target_include_directories(g3dlib
${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(g3dlib
PRIVATE
acore-dependency-interface
PUBLIC
zlib
threads)

View File

@@ -22,10 +22,14 @@ target_include_directories(gsoap
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(gsoap
PRIVATE
acore-dependency-interface)
set_target_properties(gsoap
PROPERTIES
FOLDER
"deps")
PROPERTIES
FOLDER
"deps")
if (MSVC)
# Little fix for MSVC / Windows platforms

View File

@@ -85,6 +85,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND SERVERS AND NOT NOJEM)
-D_REENTRAN)
target_link_libraries(jemalloc
PRIVATE
acore-dependency-interface
PUBLIC
threads
${CMAKE_DL_LIBS})

View File

@@ -29,6 +29,8 @@ target_include_directories(mpq
${CMAKE_SOURCE_DIR}/deps/bzip2)
target_link_libraries(mpq
PRIVATE
acore-dependency-interface
PUBLIC
zlib
bzip2)

View File

@@ -35,6 +35,8 @@ target_include_directories(Detour
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(Detour
PRIVATE
acore-dependency-interface
PUBLIC
zlib)

View File

@@ -39,6 +39,8 @@ target_include_directories(Recast
${CMAKE_CURRENT_SOURCE_DIR}/Include)
target_link_libraries(Recast
PRIVATE
acore-dependency-interface
PUBLIC
zlib)

View File

@@ -47,6 +47,10 @@ else()
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(zlib
PRIVATE
acore-dependency-interface)
set_target_properties(zlib
PROPERTIES
FOLDER