Skip to content

Commit 473dea9

Browse files
[libc] Output all headers with LIBC_CONF_OUTPUT_ALL_HEADERS (#144114)
Following discussion from https://discourse.llvm.org/t/missing-declarations-in-header-files/86678, we decided to add a flag to output all headers. Requires #144049. - Allows outputting all headers - Minor whitespace change for alignment --------- Co-authored-by: Michael Jones <[email protected]>
1 parent 3afc2be commit 473dea9

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

libc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ endif()
135135
option(LLVM_LIBC_FULL_BUILD "Build and test LLVM libc as if it is the full libc" ${default_to_full_build})
136136
option(LLVM_LIBC_IMPLEMENTATION_DEFINED_TEST_BEHAVIOR "Build LLVM libc tests assuming our implementation-defined behavior" ON)
137137
option(LLVM_LIBC_ENABLE_LINTING "Enables linting of libc source files" OFF)
138+
option(LLVM_LIBC_ALL_HEADERS "Outputs all functions in header files, regardless of whether they are enabled on this target" OFF)
138139

139140
option(LIBC_CONFIG_PATH "The path to user provided folder that configures the build for the target system." OFF)
140141

libc/cmake/modules/LLVMLibCHeaderRules.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,13 @@ function(add_gen_header target_name)
9797
set(out_file ${LIBC_INCLUDE_DIR}/${relative_path})
9898
set(dep_file "${out_file}.d")
9999
set(yaml_file ${CMAKE_SOURCE_DIR}/${ADD_GEN_HDR_YAML_FILE})
100+
101+
if(LLVM_LIBC_ALL_HEADERS)
102+
set(entry_points "")
103+
else()
104+
set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}")
105+
endif()
100106

101-
set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}")
102107
list(TRANSFORM entry_points PREPEND "--entry-point=")
103108

104109
add_custom_command(

libc/test/UnitTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function(add_unittest_framework_library name)
3535
else()
3636
_get_common_test_compile_options(compile_options "" "")
3737
target_compile_options(${name}.unit PRIVATE ${compile_options})
38-
endif()
38+
endif()
3939

4040
_get_hermetic_test_compile_options(compile_options "")
4141
target_include_directories(${name}.hermetic PRIVATE ${LIBC_INCLUDE_DIR})

0 commit comments

Comments
 (0)