Add ability to disable building LLVM utils
authorPete Cooper <peter_cooper@apple.com>
Wed, 2 Apr 2014 22:49:58 +0000 (22:49 +0000)
committerPete Cooper <peter_cooper@apple.com>
Wed, 2 Apr 2014 22:49:58 +0000 (22:49 +0000)
Patch by Chris Bieneman

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205478 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 8ddf7beeb15d970ca3d3bb441942c0e815076e59..624f755fd54f354d9e1dc0f19413b187f87536d2 100644 (file)
@@ -273,6 +273,8 @@ option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
 option(LLVM_BUILD_TOOLS
   "Build the LLVM tools. If OFF, just generate build targets." ON)
 
+option(LLVM_INCLUDE_UTILS "Generate build targets for the LLVM utils." ON)
+
 option(LLVM_BUILD_RUNTIME
   "Build the LLVM runtime libraries." ON)
 option(LLVM_BUILD_EXAMPLES
@@ -492,12 +494,19 @@ add_subdirectory(include/llvm)
 
 add_subdirectory(lib)
 
-add_subdirectory(utils/FileCheck)
-add_subdirectory(utils/FileUpdate)
-add_subdirectory(utils/count)
-add_subdirectory(utils/not)
-add_subdirectory(utils/llvm-lit)
-add_subdirectory(utils/yaml-bench)
+if( LLVM_INCLUDE_UTILS )
+  add_subdirectory(utils/FileCheck)
+  add_subdirectory(utils/FileUpdate)
+  add_subdirectory(utils/count)
+  add_subdirectory(utils/not)
+  add_subdirectory(utils/llvm-lit)
+  add_subdirectory(utils/yaml-bench)
+else()
+  if ( LLVM_INCLUDE_TESTS )
+    message(FATAL_ERROR "Including tests when not building utils will not work.
+    Either set LLVM_INCLUDE_UTILS to On, or set LLVM_INCLDE_TESTS to Off.")
+  endif()
+endif()
 
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(utils/unittest)