[PATCH] D20883: [cmake] Fix builds with LLVM_ENABLE_PIC=0

Pavel Labath via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 1 15:34:48 PDT 2016


labath created this revision.
labath added a reviewer: beanz.
labath added a subscriber: cfe-commits.

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.

http://reviews.llvm.org/D20883

Files:
  test/CMakeLists.txt

Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -68,14 +68,20 @@
     FileCheck count not
     llc
     llvm-bcanalyzer
-    llvm-lto
     llvm-objdump
     llvm-profdata
     llvm-readobj
     llvm-symbolizer
-    LTO
     opt
     )
+
+  if(TARGET llvm-lto)
+    set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
+  endif()
+
+  if(TARGET LTO)
+    set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} LTO)
+  endif()
 endif()
 
 add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20883.59293.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160601/76ba9d96/attachment.bin>


More information about the cfe-commits mailing list