PorygonLang/CMakeLists.txt

29 lines
849 B
CMake
Raw Normal View History

2019-06-06 18:15:45 +00:00
cmake_minimum_required(VERSION 3.10)
2019-05-18 18:35:51 +00:00
project(PorygonLang)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(extern)
2019-05-18 18:35:51 +00:00
2019-09-05 08:59:01 +00:00
if (WINDOWS)
ADD_DEFINITIONS(-D WINDOWS=1)
endif(WINDOWS)
2019-05-21 15:23:56 +00:00
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
2019-05-21 11:05:17 +00:00
add_library(PorygonLang SHARED ${SRC_FILES})
2019-05-21 11:05:17 +00:00
add_executable(PorygonLangTests
${SRC_FILES}
2019-05-21 15:23:56 +00:00
${TEST_FILES})
2019-05-18 18:35:51 +00:00
target_link_libraries(PorygonLang -static-libgcc -static-libstdc++)
target_link_libraries(PorygonLangTests -static-libgcc -static-libstdc++)
2019-08-11 14:05:14 +00:00
if (WINDOWS)
target_link_libraries(PorygonLang -static -static-libgcc -static-libstdc++)
target_link_libraries(PorygonLangTests -static -static-libgcc -static-libstdc++)
2019-08-11 14:05:14 +00:00
endif(WINDOWS)
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)