|
1 | 1 | cmake_minimum_required(VERSION 3.20.0)
|
2 | 2 | set(LLVM_SUBPROJECT_TITLE "libc")
|
3 | 3 |
|
4 |
| -include(CheckCXXCompilerFlag) |
5 |
| - |
6 | 4 | # Include LLVM's cmake policies.
|
7 | 5 | if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
|
8 | 6 | set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
|
@@ -55,19 +53,18 @@ set(LIBC_NAMESPACE ${default_namespace}
|
55 | 53 |
|
56 | 54 | add_subdirectory(newhdrgen)
|
57 | 55 |
|
58 |
| -if(NOT LIBC_USE_NEW_HEADER_GEN) |
59 |
| - if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD) |
60 |
| - if(NOT LIBC_HDRGEN_EXE) |
61 |
| - # We need to set up hdrgen first since other targets depend on it. |
62 |
| - add_subdirectory(utils/LibcTableGenUtil) |
63 |
| - add_subdirectory(utils/HdrGen) |
64 |
| - # Calling add_tablegen sets variables like LIBC_TABLEGEN_EXE in |
65 |
| - # PARENT_SCOPE which get lost until saved in the cache. |
66 |
| - set(LIBC_TABLEGEN_EXE "${LIBC_TABLEGEN_EXE}" CACHE INTERNAL "") |
67 |
| - set(LIBC_TABLEGEN_TARGET "${LIBC_TABLEGEN_TARGET}" CACHE INTERNAL "") |
68 |
| - else() |
69 |
| - message(STATUS "Will use ${LIBC_HDRGEN_EXE} for libc header generation.") |
70 |
| - endif() |
| 56 | + |
| 57 | +if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD) |
| 58 | + if(NOT LIBC_HDRGEN_EXE) |
| 59 | + # We need to set up hdrgen first since other targets depend on it. |
| 60 | + add_subdirectory(utils/LibcTableGenUtil) |
| 61 | + add_subdirectory(utils/HdrGen) |
| 62 | + # Calling add_tablegen sets variables like LIBC_TABLEGEN_EXE in |
| 63 | + # PARENT_SCOPE which get lost until saved in the cache. |
| 64 | + set(LIBC_TABLEGEN_EXE "${LIBC_TABLEGEN_EXE}" CACHE INTERNAL "") |
| 65 | + set(LIBC_TABLEGEN_TARGET "${LIBC_TABLEGEN_TARGET}" CACHE INTERNAL "") |
| 66 | + else() |
| 67 | + message(STATUS "Will use ${LIBC_HDRGEN_EXE} for libc header generation.") |
71 | 68 | endif()
|
72 | 69 | endif()
|
73 | 70 | # We will build the GPU utilities if we are not doing a runtimes build.
|
@@ -356,9 +353,7 @@ endif()
|
356 | 353 |
|
357 | 354 | option(LLVM_LIBC_INCLUDE_SCUDO "Include the SCUDO standalone as the allocator for LLVM libc" OFF)
|
358 | 355 | if(LLVM_LIBC_INCLUDE_SCUDO)
|
359 |
| - if (LLVM_LIBC_COMPILER_RT_PATH) |
360 |
| - add_subdirectory(${LLVM_LIBC_COMPILER_RT_PATH} ${CMAKE_CURRENT_BINARY_DIR}/compiler-rt) |
361 |
| - elseif(NOT ("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS OR "compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES)) |
| 356 | + if (NOT ("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS OR "compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES)) |
362 | 357 | message(FATAL_ERROR "SCUDO cannot be included without adding compiler-rt to LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")
|
363 | 358 | endif()
|
364 | 359 | endif()
|
|
0 commit comments