-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
55 lines (44 loc) · 1.6 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.21)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "CMake build configuration")
file(REAL_PATH ${CMAKE_CURRENT_LIST_DIR}/../ PROJECT_ROOT_DIR)
include(cmake/dependencies.cmake)
ProvideLlvm()
ProvideArmGnuToolchain()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/llvm_toolchain_file.cmake CACHE PATH
"Path to the CMake's toolchain file")
project(LlvmArmBaremetal
VERSION 0.1.1
LANGUAGES CXX C ASM)
option(LLVM_BAREMETAL_ARM_BUILD_COMPILER_RT_ONLY
"If set to ON, will build only the compiler-rt, otherwise it will also build libc++, libc++abi and libunwind"
OFF)
option(LLVM_BAREMETAL_ARM_INSTALL_NEWLIB "Install newlib libc and friends" ON)
option(LLVM_BAREMETAL_ARM_ENABLE_EXCEPTIONS "Enable exceptions in libc++ and libc++abi" ON)
if(LLVM_BAREMETAL_ARM_ENABLE_EXCEPTIONS)
set(LIBCXX_ENABLE_EXCEPTIONS ON CACHE BOOL "" FORCE)
set(LIBCXXABI_ENABLE_EXCEPTIONS ON CACHE BOOL "" FORCE)
else()
set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED OFF)
set(CMAKE_C_EXTENSIONS ON)
include(cmake/utils.cmake)
include(cmake/llvm_project.cmake)
ConfigurePackaging()
AddPackagingTarget()
ProvideLlvmProject()
EnableCompilerRt()
if(NOT LLVM_BAREMETAL_ARM_BUILD_COMPILER_RT_ONLY)
EnableLibcxx()
EnableLibcxxAbi()
EnableLibunwind()
endif()
add_subdirectory(src)
if(LLVM_BAREMETAL_ARM_INSTALL_NEWLIB)
include(cmake/newlib.cmake)
endif()