forked from OSchip/llvm-project
[cmake] Fix _GNU_SOURCE being added unconditionally
Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D137917
This commit is contained in:
parent
67d311a5fd
commit
8da41fe696
|
@ -414,8 +414,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions( -D_GNU_SOURCE )
|
||||
|
||||
option(CLANG_BUILD_TOOLS
|
||||
"Build the Clang tools. If OFF, just generate build targets." ON)
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ endif()
|
|||
|
||||
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
|
||||
if( LLVM_USING_GLIBC )
|
||||
add_definitions( -D_GNU_SOURCE )
|
||||
add_compile_definitions(_GNU_SOURCE)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
|
||||
endif()
|
||||
# This check requires _GNU_SOURCE
|
||||
|
|
Loading…
Reference in New Issue