-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
41 lines (25 loc) · 1.13 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required (VERSION 3.7)
project (pascal_compiler VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(fmt)
add_executable(compiler src/main.cpp src/lexer.cpp src/parser.cpp)
target_link_libraries(compiler PUBLIC fmt)
add_executable(massager src/grammar_massager.cpp)
target_link_libraries(massager PUBLIC fmt)
if(MSVC)
target_compile_options(compiler PRIVATE "/std:c++17")
target_compile_options(compiler PRIVATE "/permissive-")
target_compile_options(massager PRIVATE "/std:c++17")
target_compile_options(massager PRIVATE "/permissive-")
endif(MSVC)
add_custom_command(
TARGET compiler POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/test_input
${CMAKE_CURRENT_BINARY_DIR}/test_input)
add_custom_command(TARGET compiler POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/test_input $<TARGET_FILE_DIR:compiler>/test_input)
add_custom_command(TARGET massager POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/grammars $<TARGET_FILE_DIR:massager>/grammars)