-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (46 loc) · 1.55 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.0.0)
project(zizl VERSION 0.1.0)
set (CMAKE_CXX_STANDARD 20)
cmake_policy(SET CMP0069 NEW)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/lexer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ir.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/sema.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/interp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/native_functions.cpp
)
add_executable(zizl ${SRC})
target_include_directories(zizl
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib
)
if(${LTO})
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
if(MSVC)
target_compile_options(zizl PRIVATE
/W3
# /Wall
# # # C5045 Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
# /wd5045
# # # C5039 'function': pointer or reference to potentially throwing function passed to extern C function under -EHc. Undefined behavior may occur if this function throws an exception.
# /wd5039
# # # C4668 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
# /wd4668
# /wd5027
# /wd4626
# /wd4820
# /wd4061
# /wd4062
# /wd4623
)
else()
target_compile_options(zizl PRIVATE -Wall -Wextra -pedantic)
endif()