cmake_minimum_required(VERSION 3.20) project(remorse_rebuild LANGUAGES CXX) add_library(remorse_core src/animation_archive.cpp src/combat_tactics.cpp src/collision.cpp src/entity_dispatch_entry.cpp src/file_system.cpp src/flex_archive.cpp src/fixed_map.cpp src/glob_archive.cpp src/map_renderer.cpp src/map_sorter.cpp src/palette.cpp src/runtime.cpp src/shape_archive.cpp src/type_flags.cpp src/usecode_archive.cpp src/usecode_vm.cpp ) target_compile_features(remorse_core PUBLIC cxx_std_17) target_include_directories(remorse_core PUBLIC include) add_executable(remorse_rebuild src/main.cpp ) target_link_libraries(remorse_rebuild PRIVATE remorse_core) add_executable(remorse_map_preview src/map_preview_main.cpp ) target_link_libraries(remorse_map_preview PRIVATE remorse_core) if(WIN32) add_executable(remorse_game WIN32 src/windowed_game_main.cpp ) target_link_libraries(remorse_game PRIVATE remorse_core user32 gdi32) endif() enable_testing() add_executable(entity_dispatch_entry_tests tests/entity_dispatch_entry_tests.cpp ) target_link_libraries(entity_dispatch_entry_tests PRIVATE remorse_core) add_test(NAME entity_dispatch_entry_tests COMMAND entity_dispatch_entry_tests) add_executable(file_system_tests tests/file_system_tests.cpp ) target_link_libraries(file_system_tests PRIVATE remorse_core) add_test(NAME file_system_tests COMMAND file_system_tests) add_executable(palette_tests tests/palette_tests.cpp ) target_link_libraries(palette_tests PRIVATE remorse_core) add_test(NAME palette_tests COMMAND palette_tests) add_executable(flex_archive_tests tests/flex_archive_tests.cpp ) target_link_libraries(flex_archive_tests PRIVATE remorse_core) add_test(NAME flex_archive_tests COMMAND flex_archive_tests) add_executable(fixed_map_tests tests/fixed_map_tests.cpp ) target_link_libraries(fixed_map_tests PRIVATE remorse_core) add_test(NAME fixed_map_tests COMMAND fixed_map_tests) add_executable(glob_archive_tests tests/glob_archive_tests.cpp ) target_link_libraries(glob_archive_tests PRIVATE remorse_core) add_test(NAME glob_archive_tests COMMAND glob_archive_tests) add_executable(type_flags_tests tests/type_flags_tests.cpp ) target_link_libraries(type_flags_tests PRIVATE remorse_core) add_test(NAME type_flags_tests COMMAND type_flags_tests) add_executable(shape_archive_tests tests/shape_archive_tests.cpp ) target_link_libraries(shape_archive_tests PRIVATE remorse_core) add_test(NAME shape_archive_tests COMMAND shape_archive_tests) add_executable(map_renderer_tests tests/map_renderer_tests.cpp ) target_link_libraries(map_renderer_tests PRIVATE remorse_core) add_test(NAME map_renderer_tests COMMAND map_renderer_tests) add_executable(map_sorter_tests tests/map_sorter_tests.cpp ) target_link_libraries(map_sorter_tests PRIVATE remorse_core) add_test(NAME map_sorter_tests COMMAND map_sorter_tests) add_executable(isometric_controls_tests tests/isometric_controls_tests.cpp ) target_link_libraries(isometric_controls_tests PRIVATE remorse_core) add_test(NAME isometric_controls_tests COMMAND isometric_controls_tests) add_executable(animation_archive_tests tests/animation_archive_tests.cpp ) target_link_libraries(animation_archive_tests PRIVATE remorse_core) add_test(NAME animation_archive_tests COMMAND animation_archive_tests) add_executable(collision_tests tests/collision_tests.cpp ) target_link_libraries(collision_tests PRIVATE remorse_core) add_test(NAME collision_tests COMMAND collision_tests) add_executable(combat_tactics_tests tests/combat_tactics_tests.cpp ) target_link_libraries(combat_tactics_tests PRIVATE remorse_core) add_test(NAME combat_tactics_tests COMMAND combat_tactics_tests) add_executable(usecode_vm_tests tests/usecode_vm_tests.cpp ) target_link_libraries(usecode_vm_tests PRIVATE remorse_core) add_test(NAME usecode_vm_tests COMMAND usecode_vm_tests) add_library(remorse_test_crash_setup OBJECT tests/test_crash_setup.cpp) target_link_libraries(remorse_test_crash_setup PRIVATE remorse_core) foreach(test_target IN ITEMS entity_dispatch_entry_tests file_system_tests palette_tests flex_archive_tests fixed_map_tests glob_archive_tests type_flags_tests shape_archive_tests map_renderer_tests map_sorter_tests isometric_controls_tests animation_archive_tests collision_tests combat_tactics_tests usecode_vm_tests) target_sources(${test_target} PRIVATE $) endforeach() if(MSVC) target_compile_options(remorse_core PRIVATE /W4 /permissive-) target_compile_options(combat_tactics_tests PRIVATE /W4 /permissive-) target_compile_options(map_renderer_tests PRIVATE /W4 /permissive-) target_compile_options(map_sorter_tests PRIVATE /W4 /permissive-) target_compile_options(isometric_controls_tests PRIVATE /W4 /permissive-) target_compile_options(animation_archive_tests PRIVATE /W4 /permissive-) target_compile_options(collision_tests PRIVATE /W4 /permissive-) target_compile_options(usecode_vm_tests PRIVATE /W4 /permissive-) target_compile_options(remorse_map_preview PRIVATE /W4 /permissive-) if(WIN32) target_compile_options(remorse_game PRIVATE /W4 /permissive-) endif() target_compile_options(remorse_rebuild PRIVATE /W4 /permissive-) target_compile_options(entity_dispatch_entry_tests PRIVATE /W4 /permissive-) target_compile_options(file_system_tests PRIVATE /W4 /permissive-) target_compile_options(flex_archive_tests PRIVATE /W4 /permissive-) target_compile_options(fixed_map_tests PRIVATE /W4 /permissive-) target_compile_options(glob_archive_tests PRIVATE /W4 /permissive-) target_compile_options(palette_tests PRIVATE /W4 /permissive-) target_compile_options(shape_archive_tests PRIVATE /W4 /permissive-) target_compile_options(type_flags_tests PRIVATE /W4 /permissive-) else() target_compile_options(remorse_core PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(combat_tactics_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(map_renderer_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(map_sorter_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(isometric_controls_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(animation_archive_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(collision_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(usecode_vm_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(remorse_map_preview PRIVATE -Wall -Wextra -Wpedantic) if(WIN32) target_compile_options(remorse_game PRIVATE -Wall -Wextra -Wpedantic) endif() target_compile_options(remorse_rebuild PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(entity_dispatch_entry_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(file_system_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(flex_archive_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(fixed_map_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(glob_archive_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(palette_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(shape_archive_tests PRIVATE -Wall -Wextra -Wpedantic) target_compile_options(type_flags_tests PRIVATE -Wall -Wextra -Wpedantic) endif()