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

View File

@@ -1,18 +1,33 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
# Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/>
#
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE="'${CMAKE_BUILD_TYPE}'")
target_compile_definitions(acore-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}")
if(PLATFORM EQUAL 32)
add_definitions(-axSSE2)
target_compile_options(acore-compile-option-interface
INTERFACE
-axSSE2)
else()
add_definitions(-xSSE2)
target_compile_options(acore-compile-option-interface
INTERFACE
-xSSE2)
endif()
if( WITH_WARNINGS )
add_definitions(-w1)
if(WITH_WARNINGS)
target_compile_options(acore-warning-interface
INTERFACE
-w1)
message(STATUS "ICC: All warnings enabled")
endif()
if( WITH_COREDEBUG )
add_definitions(-g)
if(WITH_COREDEBUG)
target_compile_options(acore-compile-option-interface
INTERFACE
-g)
message(STATUS "ICC: Debug-flag set (-g)")
endif()