-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
50 lines (37 loc) · 1.32 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
cmake_minimum_required(VERSION 3.17)
project("bitsy-llvm")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS false)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in '${LLVM_DIR}'")
configure_file(include/helper/ClangPath.hpp.in include/helper/ClangPath.hpp)
include_directories(include ${PROJECT_BINARY_DIR}/include SYSTEM ${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
# Find the libraries that correspond to the LLVM components that we wish to use.
llvm_map_components_to_libnames(
BITSYC_LLVM_LIBRARIES
MCJIT
nativecodegen
Passes
)
add_executable(
bitsyc
src/bitsyc.cpp
src/ast/ASTPrinter.cpp
src/codegen/CodeGenerator.cpp
src/codegen/ModuleBuilder.cpp
src/execution/ModuleProcessor.cpp
src/helper/ConsolePrinter.cpp
src/parser/Parser.cpp
)
set_target_properties(bitsyc PROPERTIES VISIBILITY_INLINES_HIDDEN true)
target_compile_options(bitsyc PRIVATE -Wall -Wextra -Wdeprecated -Wconversion -pedantic)
if(NOT LLVM_ENABLE_RTTI)
message(STATUS "Building without RTTI")
target_compile_options(bitsyc PRIVATE -fno-rtti)
endif()
# Link against LLVM libraries.
target_link_libraries(bitsyc ${BITSYC_LLVM_LIBRARIES})