chore: update CMakeList.txt

- link `uno-game-lib` to `uno-game` instead of add sources to `uno-game`
- styled `CMakedList.txt` and `test/CMakeList.txt`
This commit is contained in:
Kieran Kihn
2025-11-20 13:32:15 +08:00
parent 65b932fc47
commit 6393a5b311
2 changed files with 7 additions and 9 deletions

View File

@@ -5,24 +5,21 @@ set(CMAKE_CXX_STANDARD 26)
find_package(ftxui CONFIG REQUIRED)
add_executable(uno-game src/main.cpp
add_library(uno-game-lib
src/game/Card.cpp
src/game/CardTile.cpp
src/game/Player.cpp
src/game/GameState.cpp
src/common/Utils.cpp
)
add_executable(uno-game src/main.cpp)
target_link_libraries(uno-game
PRIVATE uno-game-lib)
target_link_libraries(uno-game
PRIVATE ftxui::screen
PRIVATE ftxui::dom
PRIVATE ftxui::component
)
add_library(uno-game-lib src/game/Card.cpp
src/game/CardTile.cpp
src/game/Player.cpp
src/game/GameState.cpp
src/common/Utils.cpp
)
add_subdirectory(test)