[compiler-rt] Error only if sanitizer builds are enabled (#187944)
This fix is to error out only if sanitizer builds are enabled as opposed to forcing flang to use an option or install the development package.
This commit is contained in:
parent
0e5e434f99
commit
6a8a1008b5
@ -14,16 +14,17 @@ include(CompilerRTDarwinUtils)
|
||||
check_include_file(unwind.h HAVE_UNWIND_H)
|
||||
|
||||
# Used by sanitizer_common and tests.
|
||||
set(_rpc_xdr_header "rpc/xdr.h")
|
||||
set(_default_require_rpc_xdr_h OFF)
|
||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES AIX)
|
||||
set(_rpc_xdr_header "tirpc/rpc/xdr.h")
|
||||
set(_default_require_rpc_xdr_h ON)
|
||||
else()
|
||||
set(_rpc_xdr_header "rpc/xdr.h")
|
||||
set(_default_require_rpc_xdr_h OFF)
|
||||
if (COMPILER_RT_BUILD_SANITIZERS)
|
||||
set(_default_require_rpc_xdr_h ON)
|
||||
endif()
|
||||
endif()
|
||||
check_include_file(${_rpc_xdr_header} HAVE_RPC_XDR_H)
|
||||
option(COMPILER_RT_REQUIRE_RPC_XDR_H
|
||||
"Require ${_rpc_xdr_header} for sanitizer builds (default ON for AIX, OFF elsewhere). \
|
||||
"Require ${_rpc_xdr_header} for sanitizer builds (default ON for AIX when sanitizers are enabled, OFF elsewhere). \
|
||||
Set to OFF to bypass the missing-header error."
|
||||
${_default_require_rpc_xdr_h})
|
||||
if (NOT HAVE_RPC_XDR_H)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user