[PATCH] D55001: [CMake] Fix build with -DLLVM_TOOL_LLVM_{MCA/EXEGESIS}_BUILD=OFF

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 28 06:12:23 PST 2018


arichardson created this revision.
arichardson added a reviewer: beanz.
Herald added subscribers: llvm-commits, courbet, mgorny.

I have been trying to reduce our Jenkins build times by not building tools
that aren't used in dependent jobs and noticed that not building llvm-mca
or llvm-exegesis broke the CMake configure for tests.

llvm-mca and llvm-exegesis seem to be the only tools worth disabling to
save build time since they contain more than just a couple of source files
and are not needed for any of the other tests.


Repository:
  rL LLVM

https://reviews.llvm.org/D55001

Files:
  test/CMakeLists.txt
  unittests/tools/CMakeLists.txt


Index: unittests/tools/CMakeLists.txt
===================================================================
--- unittests/tools/CMakeLists.txt
+++ unittests/tools/CMakeLists.txt
@@ -4,7 +4,7 @@
   )
 endif()
 
-add_subdirectory(
-  llvm-exegesis
-)
+if(TARGET llvm-exegesis)
+  add_subdirectory(llvm-exegesis)
+endif()
 
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -61,14 +61,12 @@
           dsymutil
           llvm-dwarfdump
           llvm-dwp
-          llvm-exegesis
           llvm-extract
           llvm-isel-fuzzer
           llvm-lib
           llvm-link
           llvm-lto2
           llvm-mc
-          llvm-mca
           llvm-modextract
           llvm-mt
           llvm-nm
@@ -101,8 +99,14 @@
           yaml2obj
         )
 
+if(TARGET llvm-mca)
+  list(APPEND LLVM_TEST_DEPENDS llvm-mca)
+endif()
+if(TARGET llvm-exegesis)
+  list(APPEND LLVM_TEST_DEPENDS llvm-exegesis)
+endif()
 if(TARGET llvm-lto)
-  set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
+  list(APPEND LLVM_TEST_DEPENDS llvm-lto)
 endif()
 
 # If Intel JIT events are supported, depend on a tool that tests the listener.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55001.175678.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181128/c62d6836/attachment.bin>


More information about the llvm-commits mailing list