mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Build: Provide an interface target for game
* Increases the build time because dependent projects can build
without waiting for the game project.
(cherry picked from commit ff8a54ab92)
This commit is contained in:
@@ -23,27 +23,36 @@ GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_definitions(-DTRINITY_API_EXPORT_GAME)
|
||||
|
||||
add_library(game
|
||||
${PRIVATE_PCH_SOURCE}
|
||||
${PRIVATE_SOURCES}
|
||||
)
|
||||
|
||||
CollectIncludeDirectories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PUBLIC_INCLUDES
|
||||
# Exclude
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
|
||||
|
||||
# Provide an interface target for the game project to allow
|
||||
# dependent projects to build meanwhile.
|
||||
add_library(game-interface INTERFACE)
|
||||
|
||||
target_include_directories(game-interface
|
||||
INTERFACE
|
||||
${PUBLIC_INCLUDES})
|
||||
|
||||
target_link_libraries(game-interface
|
||||
INTERFACE
|
||||
shared
|
||||
Detour)
|
||||
|
||||
add_library(game
|
||||
${PRIVATE_PCH_SOURCE}
|
||||
${PRIVATE_SOURCES})
|
||||
|
||||
target_include_directories(game
|
||||
PUBLIC
|
||||
${PUBLIC_INCLUDES}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(game
|
||||
PUBLIC
|
||||
shared
|
||||
Detour
|
||||
game-interface
|
||||
PRIVATE
|
||||
efsw)
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ add_library(scripts STATIC
|
||||
|
||||
target_link_libraries(scripts
|
||||
PUBLIC
|
||||
game)
|
||||
game-interface)
|
||||
|
||||
target_include_directories(scripts
|
||||
PUBLIC
|
||||
|
||||
@@ -48,6 +48,7 @@ set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAG
|
||||
target_link_libraries(worldserver
|
||||
PUBLIC
|
||||
scripts
|
||||
game
|
||||
readline)
|
||||
|
||||
CollectIncludeDirectories(
|
||||
|
||||
Reference in New Issue
Block a user