refactor(Cmake): add support build selected applications and tools (#11836)

This commit is contained in:
Kargatum
2022-05-31 17:05:39 +07:00
committed by GitHub
parent 40a5eef152
commit 4fbec972a8
56 changed files with 1006 additions and 622 deletions

View File

@@ -16,8 +16,21 @@ CollectSourceFiles(
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/Debugging
${CMAKE_CURRENT_SOURCE_DIR}/Platform
${CMAKE_CURRENT_SOURCE_DIR}/Collision
${CMAKE_CURRENT_SOURCE_DIR}/Navigation
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (BUILD_APPLICATION_WORLDSERVER OR BUILD_TOOLS_MAPS)
unset(PRIVATE_SOURCES)
CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/Debugging
${CMAKE_CURRENT_SOURCE_DIR}/Platform
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
endif()
# Manually set sources for Debugging directory as we don't want to include WheatyExceptionReport in common project
# It needs to be included both in authserver and worldserver for the static global variable to be properly initialized
# and to handle crash logs on windows
@@ -55,8 +68,6 @@ target_link_libraries(common
PUBLIC
boost
argon2
g3dlib
Detour
sfmt
utf8cpp
openssl
@@ -65,6 +76,13 @@ target_link_libraries(common
stdfs
fmt)
if (BUILD_APPLICATION_WORLDSERVER OR BUILD_TOOLS_MAPS)
target_link_libraries(common
PUBLIC
g3dlib
Detour)
endif()
set_target_properties(common
PROPERTIES
FOLDER

View File

@@ -60,7 +60,7 @@ private:
public:
static Log* instance();
void Initialize(Acore::Asio::IoContext* ioContext);
void Initialize(Acore::Asio::IoContext* ioContext = nullptr);
void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined
void LoadFromConfig();
void Close();