File tree 1 file changed +0
-20
lines changed
1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 1
1
include (GetLibraryName)
2
2
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
-
23
3
if (LLVM_ENABLE_ZLIB)
24
4
set (imported_libs ZLIB::ZLIB)
25
5
endif ()
You can’t perform that action at this time.
0 commit comments