Skip to content

Commit 3211ead

Browse files
committed
Revert "Build libSupport with -Werror=global-constructors (NFC)"
This reverts commit 579cc9a. This breaks on Windows.
1 parent 579cc9a commit 3211ead

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
include(GetLibraryName)
22

3-
# Ensure that libSupport does not carry any static global initializer.
4-
# libSupport can be embedded in use cases where we don't want to load all
5-
# cl::opt unless we want to parse the command line.
6-
# ManagedStatic can be used to enable lazy-initialization of globals.
7-
# We don't use `add_flag_if_supported` as instead of compiling an empty file we
8-
# check if the current platform is able to compile global std::mutex with this
9-
# flag (Linux can, Darwin can't for example).
10-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=global-constructors")
11-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=global-constructors")
12-
CHECK_CXX_SOURCE_COMPILES("
13-
#include <mutex>
14-
static std::mutex TestGlobalCtorDtor;
15-
static std::recursive_mutex TestGlobalCtorDtor2;
16-
int main() { (void)TestGlobalCtorDtor; (void)TestGlobalCtorDtor2; return 0;}
17-
" LLVM_HAS_NOGLOBAL_CTOR_MUTEX)
18-
if (NOT LLVM_HAS_NOGLOBAL_CTOR_MUTEX)
19-
string(REPLACE "-Werror=global-constructors" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
20-
string(REPLACE "-Werror=global-constructors" "" CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
21-
endif()
22-
233
if(LLVM_ENABLE_ZLIB)
244
set(imported_libs ZLIB::ZLIB)
255
endif()

0 commit comments

Comments
 (0)