diff options
author | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-02-01 15:35:25 +0000 |
---|---|---|
committer | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-02-01 15:35:25 +0000 |
commit | a576b39f62ffcaa7241ef6606721239cdbe1fa0e (patch) | |
tree | b1a9784ca9f54ef15f2f706fdafc9762f2dd0aa2 /runtime/CMakeLists.txt | |
parent | 4487ce9559235c536a49be3d859f91d88386dc45 (diff) | |
download | clang-a576b39f62ffcaa7241ef6606721239cdbe1fa0e.tar.gz |
[CMake] External compiler-rt-configure requires LLVMTestingSupport when including tests
Summary:
Apparently `LLVMTestingSupport` must be built before `llvm-config` can be asked for it. Symptom with `LLVM_INCLUDE_TESTS=ON` is:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
llvm-config: error: component libraries and shared library
llvm-config: error: missing: /path/to/llvm-build/lib/libLLVMTestingSupport.a
```
With `LLVMTestingSupport` as dependency of `compiler-rt-configure` we get the expected behavior:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMTestingSupport -lLLVMSupport -lLLVMDemangle
```
Reviewers: ab, beanz
Subscribers: dberris, mgorny, erik.pilkington, llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D57521
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/CMakeLists.txt')
-rw-r--r-- | runtime/CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 6f453f96d7..0bb0a0aea3 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -58,12 +58,16 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) endif() endforeach() + set(compiler_rt_configure_deps) if(TARGET cxx-headers) - set(COMPILER_RT_LIBCXX_DEPENDENCY "cxx-headers") + list(APPEND compiler_rt_configure_deps "cxx-headers") + endif() + if(LLVM_INCLUDE_TESTS) + list(APPEND compiler_rt_configure_deps LLVMTestingSupport) endif() ExternalProject_Add(compiler-rt - DEPENDS llvm-config clang ${COMPILER_RT_LIBCXX_DEPENDENCY} + DEPENDS llvm-config clang ${compiler_rt_configure_deps} PREFIX ${COMPILER_RT_PREFIX} SOURCE_DIR ${COMPILER_RT_SRC_ROOT} STAMP_DIR ${STAMP_DIR} |