style: style library linking in CMakeLists.txt

This commit is contained in:
Kieran Kihn
2025-12-11 10:48:11 +08:00
parent 206286d191
commit d494f1af75

View File

@@ -24,12 +24,8 @@ add_library(uno-game-lib
src/client/PlayerAction.cpp
src/ui/GameUI.cpp
)
target_link_libraries(uno-game-lib
PUBLIC nlohmann_json::nlohmann_json
)
target_link_libraries(uno-game-lib
PUBLIC asio::asio
)
target_link_libraries(uno-game-lib PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(uno-game-lib PUBLIC asio::asio)
target_link_libraries(uno-game-lib PUBLIC Slint::Slint)
slint_target_sources(uno-game-lib ui/MainWindow.slint)
@@ -38,8 +34,7 @@ add_executable(uno-client
src/client/main.cpp
assets/uno.rc
)
target_link_libraries(uno-client
PRIVATE uno-game-lib)
target_link_libraries(uno-client PRIVATE uno-game-lib)
if (WIN32 AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(uno-client PROPERTIES WIN32_EXECUTABLE ON)
@@ -49,10 +44,7 @@ add_executable(uno-server
src/server/main.cpp
assets/uno.rc
)
target_link_libraries(uno-server
PRIVATE uno-game-lib)
target_link_libraries(uno-server
PRIVATE argparse::argparse
)
target_link_libraries(uno-server PRIVATE uno-game-lib)
target_link_libraries(uno-server PRIVATE argparse::argparse)
add_subdirectory(test)