Skip to content

Commit d895d96

Browse files
Revert "remove werror"
This reverts commit 983eab7.
1 parent 0e4c6e9 commit d895d96

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

libc/CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
3434
add_definitions("-D_DEBUG")
3535
endif()
3636

37+
add_compile_options("-Werror=extra")
38+
3739
# Default to C++17
3840
set(CMAKE_CXX_STANDARD 17)
3941

@@ -58,13 +60,6 @@ set(LIBC_NAMESPACE ${default_namespace}
5860
CACHE STRING "The namespace to use to enclose internal implementations. Must start with '__llvm_libc'."
5961
)
6062

61-
# We will build the GPU utilities if we are not doing a runtimes build.
62-
option(LIBC_BUILD_GPU_LOADER "Always build the GPU loader utilities" OFF)
63-
if(LIBC_BUILD_GPU_LOADER OR ((NOT LLVM_RUNTIMES_BUILD) AND LLVM_LIBC_GPU_BUILD))
64-
add_subdirectory(utils/gpu)
65-
return()
66-
endif()
67-
6863
option(LIBC_CMAKE_VERBOSE_LOGGING
6964
"Log details warnings and notifications during CMake configuration." OFF)
7065

@@ -128,20 +123,25 @@ else()
128123
endif()
129124
endif()
130125

131-
option(LLVM_LIBC_FULL_BUILD "Build and test LLVM libc as if it is the full libc" OFF)
126+
# Defines LIBC_TARGET_ARCHITECTURE and associated macros.
127+
set(LIBC_TARGET_TRIPLE "" CACHE STRING "The target triple for the libc build.")
128+
include(LLVMLibCArchitectures)
129+
130+
# Some targets can only support the full build.
131+
set(default_to_full_build OFF)
132+
if(LIBC_TARGET_OS_IS_GPU)
133+
set(default_to_full_build ON)
134+
endif()
135+
136+
option(LLVM_LIBC_FULL_BUILD "Build and test LLVM libc as if it is the full libc" ${default_to_full_build})
132137
option(LLVM_LIBC_IMPLEMENTATION_DEFINED_TEST_BEHAVIOR "Build LLVM libc tests assuming our implementation-defined behavior" ON)
133138
option(LLVM_LIBC_ENABLE_LINTING "Enables linting of libc source files" OFF)
134139

135-
set(LIBC_TARGET_TRIPLE "" CACHE STRING "The target triple for the libc build.")
136-
137140
option(LIBC_CONFIG_PATH "The path to user provided folder that configures the build for the target system." OFF)
138141

139142
set(LIBC_ENABLE_UNITTESTS ON)
140143
set(LIBC_ENABLE_HERMETIC_TESTS ${LLVM_LIBC_FULL_BUILD})
141144

142-
# Defines LIBC_TARGET_ARCHITECTURE and associated macros.
143-
include(LLVMLibCArchitectures)
144-
145145
set(LIBC_CONFIG_JSON_FILE_LIST "")
146146

147147
if(NOT LIBC_CONFIG_PATH)

0 commit comments

Comments
 (0)