# Code-defined tech effects: the TechId key space, the per-tech effect table, and the
# apply layer over a player's economy modifiers. Depends on game/sim for Species and
# TuningTable. Not yet wired into the root CMakeLists; add_subdirectory(src/game/effects)
# after src/game/sim. tests/game_effects/build_and_run.sh builds the same sources with
# plain g++ in the meantime.
add_library(sots_game_effects STATIC
  tech_id.cpp
  tech_effects.cpp)
target_include_directories(sots_game_effects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../..)
target_link_libraries(sots_game_effects PUBLIC sots_game_sim)
target_compile_features(sots_game_effects PUBLIC cxx_std_17)
if(NOT MSVC)
  target_compile_options(sots_game_effects PRIVATE -Wall -Wextra)
endif()

option(SOTS_GAME_EFFECTS_TESTS "Build the game/effects unit tests" OFF)
if(SOTS_GAME_EFFECTS_TESTS)
  enable_testing()
  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/game_effects
                   ${CMAKE_CURRENT_BINARY_DIR}/tests_game_effects)
endif()
