Files

24 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.24)
project(gameFramework VERSION 1.0 LANGUAGES CXX)
add_library(gameFramework STATIC src/Catalog.cpp src/Grid.cpp src/Profile.cpp src/Session.cpp src/Combat.cpp src/Encounter.cpp)
add_library(irons::gameFramework ALIAS gameFramework)
target_compile_features(gameFramework PUBLIC cxx_std_20)
target_include_directories(gameFramework PUBLIC include PRIVATE third_party)
set_target_properties(gameFramework PROPERTIES CXX_EXTENSIONS OFF MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
if(MSVC)
target_compile_options(gameFramework PRIVATE /W4 /utf-8 /GR- /EHsc)
else()
target_compile_options(gameFramework PRIVATE -Wall -Wextra -Wpedantic)
endif()
option(GAMEFRAMEWORK_TESTS "Build engine-independent behavior tests" ON)
if(GAMEFRAMEWORK_TESTS)
enable_testing()
add_executable(gameFrameworkTests tests/BehaviorTests.cpp)
target_link_libraries(gameFrameworkTests PRIVATE irons::gameFramework)
set_target_properties(gameFrameworkTests PROPERTIES MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
if(MSVC)
target_compile_options(gameFrameworkTests PRIVATE /utf-8 /EHsc /GR-)
endif()
add_test(NAME gameFrameworkBehavior COMMAND gameFrameworkTests)
endif()