cmake_minimum_required(VERSION 3.21)
project(HopePortableCore VERSION 0.1.0 LANGUAGES CXX)

add_library(HopePortableCore STATIC
    src/hope_core.cpp
)
target_include_directories(HopePortableCore PUBLIC include)
target_compile_features(HopePortableCore PUBLIC cxx_std_20)

if(MSVC)
    target_compile_options(HopePortableCore PRIVATE /W4 /permissive-)
else()
    target_compile_options(HopePortableCore PRIVATE -Wall -Wextra -Wpedantic)
endif()

include(CTest)
if(BUILD_TESTING)
    add_executable(HopePortableCoreTests tests/hope_core_tests.cpp)
    target_link_libraries(HopePortableCoreTests PRIVATE HopePortableCore)
    add_test(NAME HopePortableCoreTests COMMAND HopePortableCoreTests)
endif()
