Core/Build: Provide an interface target for game
* Increases the build time because dependent projects can build without waiting for the game project.
This commit is contained in:
1 parent
08341818f6
commit
e27a5b7816
3 files changed
+20
-11
No files matched your search
@@ -8,7 +8,6 @@
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
CollectSourceFiles(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE_SOURCES
|
||||
@@ -24,28 +23,37 @@ GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_definitions(-DTRINITY_API_EXPORT_GAME)
|
||||
|
||||
add_library(game
|
||||
${PRIVATE_SOURCES}
|
||||
${PRIVATE_PCH_SOURCE}
|
||||
)
|
||||
|
||||
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
|
||||
ipc
|
||||
shared
|
||||
Detour
|
||||
game-interface
|
||||
PRIVATE
|
||||
efsw)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ target_include_directories(scripts
|
||||
|
||||
target_link_libraries(scripts
|
||||
PUBLIC
|
||||
game)
|
||||
game-interface)
|
||||
|
||||
set_target_properties(scripts
|
||||
PROPERTIES
|
||||
|
||||
@@ -48,6 +48,7 @@ set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAG
|
||||
target_link_libraries(worldserver
|
||||
PUBLIC
|
||||
scripts
|
||||
game
|
||||
gsoap
|
||||
readline)
|
||||
|
||||
|
||||
Reference in new issue
Block a user