-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (79 loc) · 1.52 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cmake_minimum_required(VERSION 3.0.0)
project(llang)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Packages
find_package(Boost 1.71 REQUIRED)
find_package(LLVM REQUIRED CONFIG)
llvm_map_components_to_libnames(llvm_libs
support
core
irreader
XCoreCodeGen
X86CodeGen
WebAssemblyCodeGen
SystemZCodeGen
SparcCodeGen
RISCVCodeGen
PowerPCCodeGen
NVPTXCodeGen
MSP430CodeGen
MipsCodeGen
LanaiCodeGen
HexagonCodeGen
BPFCodeGen
AVRCodeGen
ARMCodeGen
AMDGPUCodeGen
AArch64CodeGen
CodeGen
X86AsmParser
WebAssemblyAsmParser
SystemZAsmParser
SparcAsmParser
RISCVAsmParser
PowerPCAsmParser
MSP430AsmParser
MipsAsmParser
LanaiAsmParser
HexagonAsmParser
BPFAsmParser
AVRAsmParser
ARMAsmParser
AsmParser
AMDGPUAsmParser
AArch64AsmParser
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_FLAGS "-g")
set(SOURCES
src/main.cc
src/gen.cc
src/lexer.cc
src/source.cc
src/parser.cc
src/ast.cc
src/span_logic.cc
src/verify.cc
)
set(INCLUDE_DIRS
src/
${Boost_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
)
set(LIBRARIES
${Boost_LIBRARIES}
${llvm_libs}
)
add_executable(llang ${SOURCES})
target_include_directories(llang PRIVATE ${INCLUDE_DIRS})
target_link_libraries(llang ${LIBRARIES})
include(cmake/linting.cmake)
include(cmake/tests.cmake)
add_custom_target(
run
COMMAND cd ./example && ./build.sh
DEPENDS llang
)