Skip to content

Commit 97e3f62

Browse files
committed
Revert "[libc] support fully OOT build (#101287)"
This reverts commit c0efcc0.
1 parent 53a6a11 commit 97e3f62

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

libc/CMakeLists.txt

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
cmake_minimum_required(VERSION 3.20.0)
22
set(LLVM_SUBPROJECT_TITLE "libc")
33

4-
include(CheckCXXCompilerFlag)
5-
64
# Include LLVM's cmake policies.
75
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
86
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -55,19 +53,18 @@ set(LIBC_NAMESPACE ${default_namespace}
5553

5654
add_subdirectory(newhdrgen)
5755

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.")
7168
endif()
7269
endif()
7370
# We will build the GPU utilities if we are not doing a runtimes build.
@@ -356,9 +353,7 @@ endif()
356353

357354
option(LLVM_LIBC_INCLUDE_SCUDO "Include the SCUDO standalone as the allocator for LLVM libc" OFF)
358355
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))
362357
message(FATAL_ERROR "SCUDO cannot be included without adding compiler-rt to LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")
363358
endif()
364359
endif()

libc/newhdrgen/yaml_to_classes.py

100755100644
File mode changed.

0 commit comments

Comments
 (0)