Skip to content

Commit

Permalink
Modularize dependencies of the "amazons" game
Browse files Browse the repository at this point in the history
  • Loading branch information
jthemphill committed Oct 15, 2023
1 parent 8859b79 commit 2196524
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions open_spiel/games/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(GAME_SOURCES
amazons/amazons.cc
amazons/amazons.h
$<TARGET_OBJECTS:amazons>
backgammon/backgammon.cc
backgammon/backgammon.h
bargaining/bargaining.cc
Expand Down Expand Up @@ -276,9 +275,7 @@ add_executable(2048_test twenty_forty_eight/2048_test.cc ${OPEN_SPIEL_OBJECTS}
$<TARGET_OBJECTS:tests>)
add_test(2048_test 2048_test)

add_executable(amazons_test amazons/amazons_test.cc ${OPEN_SPIEL_OBJECTS}
$<TARGET_OBJECTS:tests>)
add_test(amazons_test amazons_test)
add_subdirectory(amazons)

add_executable(backgammon_test backgammon/backgammon_test.cc ${OPEN_SPIEL_OBJECTS}
$<TARGET_OBJECTS:tests>)
Expand Down
7 changes: 7 additions & 0 deletions open_spiel/games/amazons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_library(amazons OBJECT)
target_sources(amazons PRIVATE amazons.cc amazons.h)
target_link_libraries(amazons PRIVATE open_spiel_core)

add_executable(amazons_test amazons_test.cc)
target_link_libraries(amazons_test PRIVATE amazons open_spiel_core tests)
add_test(amazons_test amazons_test)

0 comments on commit 2196524

Please sign in to comment.