cmake_minimum_required(VERSION 3.10)
project(PorygonLang)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(extern)

file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")

add_library(PorygonLang SHARED ${SRC_FILES})
add_executable(PorygonLangTests
        ${SRC_FILES}
        ${TEST_FILES})

if (WINDOWS)
    target_link_libraries(PorygonLang -static)
    target_link_libraries(PorygonLangTests -static)
endif(WINDOWS)

target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)