Skip to content

Commit 42f9780

Browse files
committedJun 2, 2016
[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 the target as a dependency. Reviewers: beanz Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20883 llvm-svn: 271533
1 parent 7008ce3 commit 42f9780

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎clang/test/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,20 @@ if( NOT CLANG_BUILT_STANDALONE )
6868
FileCheck count not
6969
llc
7070
llvm-bcanalyzer
71-
llvm-lto
7271
llvm-objdump
7372
llvm-profdata
7473
llvm-readobj
7574
llvm-symbolizer
76-
LTO
7775
opt
7876
)
77+
78+
if(TARGET llvm-lto)
79+
set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
80+
endif()
81+
82+
if(TARGET LTO)
83+
set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
84+
endif()
7985
endif()
8086

8187
add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})

0 commit comments

Comments
 (0)