diff options
author | Pavel Labath <labath@google.com> | 2016-06-02 16:29:07 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-06-02 16:29:07 +0000 |
commit | df5736926978d7d6b8edc960e20090018b657966 (patch) | |
tree | 85ec135d71f224fda4e2ee78a7dab71fc3332f70 /test/CMakeLists.txt | |
parent | f9c106c07bfff3f844db9cbee5148c4cc0ef54e1 (diff) |
[cmake] Fix builds with LLVM_ENABLE_PIC=0
Summary:
When this flag is specified, the target llvm-lto is not built, but is still
used as a dependency of the test targets. cmake 2.8 silently ignored this
situation, but with cmake_minimum_required(3.4) it becomes an error. Fix this
by avoiding the inclusion of the target as a dependency.
Reviewers: beanz
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20882
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b70db69a7e5..e5773bda0e7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -43,7 +43,6 @@ set(LLVM_TEST_DEPENDS llvm-extract llvm-lib llvm-link - llvm-lto llvm-mc llvm-mcmarkup llvm-nm @@ -67,6 +66,10 @@ set(LLVM_TEST_DEPENDS yaml2obj ) +if(TARGET llvm-lto) + set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto) +endif() + # If Intel JIT events are supported, depend on a tool that tests the listener. if( LLVM_USE_INTEL_JITEVENTS ) set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-jitlistener) @@ -80,7 +83,7 @@ if(TARGET llvm-go) set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-go) endif() -if(APPLE) +if(TARGET LTO) set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO) endif() |