diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2017-08-24 23:43:17 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2017-08-24 23:43:17 +0000 |
commit | 0b17b7e25662a35869c1f0ffd8e3fa61e5e6dea5 (patch) | |
tree | 1261f30f158c3806aa59a9cff85b32790d1510c9 | |
parent | 9501638798e3cd2f30f8ed09818c8382100e6b04 (diff) |
Add Clang dependency to the check for Clang C++ headers.
The problem is that CMake is mostly imperative and the result of
processing "if (TARGET blah)" checks depends on the order of import of
CMake files.
In this case, "projects" folder is registered before "tools",
and calling "CheckClangHeaders" [renamed to have a better name]
errors out without even giving Clang a chance to be built.
This, in turn, leads to libFuzzer bot failures in some circumstances on
some machines (depends on whether LIT or UNIT tests are scheduled
first).
Differential Revision: https://reviews.llvm.org/D37126
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311733 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/Modules/CompilerRTCompile.cmake | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake index 4c6568167..d1dfb74bb 100644 --- a/cmake/Modules/CompilerRTCompile.cmake +++ b/cmake/Modules/CompilerRTCompile.cmake @@ -67,8 +67,8 @@ function(clang_compile object_file source) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS clang compiler-rt-headers) endif() - if (TARGET CompilerRTUnitTestCheckCxx) - list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) + if (TARGET CheckClangHeaders) + list(APPEND SOURCE_DEPS CheckClangHeaders) endif() string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath}) string(REGEX MATCH "[.](m|mm)$" is_objc ${source_rpath}) @@ -132,12 +132,10 @@ macro(clang_compiler_add_cxx_check) " false" "fi" ) - add_custom_target(CompilerRTUnitTestCheckCxx + add_custom_target(CheckClangHeaders COMMAND bash -c "${CMD}" COMMENT "Checking that just-built clang can find C++ headers..." VERBATIM) - if (TARGET clang) - ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang) - endif() + ADD_DEPENDENCIES(CheckClangHeaders clang) endif() endmacro() |