Skip to content

Commit

Permalink
Change to a shared library so each game's static initializer will run…
Browse files Browse the repository at this point in the history
… in each test
  • Loading branch information
jthemphill committed Oct 17, 2023
1 parent 5982505 commit d0dcf9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions open_spiel/games/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if (${OPEN_SPIEL_BUILD_WITH_ACPC})
set(GAME_SOURCES ${GAME_SOURCES} universal_poker/universal_poker.cc universal_poker/universal_poker.h)
endif()

add_library (games ${GAME_SOURCES})
add_library (games SHARED ${GAME_SOURCES})
target_link_libraries(games PRIVATE algorithms game_transforms tests utils)
target_include_directories (games PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

Expand All @@ -201,7 +201,7 @@ if (${OPEN_SPIEL_BUILD_WITH_HANABI})
endif()
if (${OPEN_SPIEL_BUILD_WITH_ACPC})
add_subdirectory(universal_poker)
target_link_libraries(games PUBLIC universal_poker_clib universal_poker_lib)
target_link_libraries(games PRIVATE universal_poker_clib universal_poker_lib)
endif()
if (${OPEN_SPIEL_BUILD_WITH_GAMUT})
add_subdirectory(gamut)
Expand Down Expand Up @@ -273,6 +273,8 @@ add_library(bridge_double_dummy_solver OBJECT
target_include_directories (bridge_double_dummy_solver PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(bridge_double_dummy_solver PUBLIC DDS_NO_STATIC_INIT)

target_link_libraries(games PRIVATE bridge_double_dummy_solver)

macro(add_game_executable)
set(options)
set(oneValueArgs NAME)
Expand Down Expand Up @@ -382,7 +384,7 @@ add_game_test(NAME ultimate_tic_tac_toe_test SOURCES ultimate_tic_tac_toe/ultima
if (${OPEN_SPIEL_BUILD_WITH_ACPC})
add_game_test(
NAME universal_poker_test
SOURCES universal_poker/universal_poker_test.cc kuhn_poker/kuhn_poker.cc leduc_poker/leduc_poker.cc
SOURCES universal_poker/universal_poker_test.cc
ARGS "--subgames_data_dir=${CMAKE_CURRENT_SOURCE_DIR}/universal_poker/endgames"
)
endif()
Expand Down

0 comments on commit d0dcf9d

Please sign in to comment.