Reverting "CMake: Don't include tools, unittets, or examples as
authorOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Sep 2010 20:25:25 +0000 (20:25 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Sep 2010 20:25:25 +0000 (20:25 +0000)
available targets unless LLVM_INCLUDE_X is ON. LLVM_BUILD_X implies
LLVM_INCLUDE_X"

It breaks the configuration phase when cmake is invoked without
parameters, it is too complex for the purpose and introduces an
incovenience for the user (as both LLVM_BUILD_X and LLVM_INCLUDE_X
must set to OFF for not including X on the build)

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

CMakeLists.txt
cmake/modules/AddLLVM.cmake
unittests/CMakeLists.txt
utils/unittest/CMakeLists.txt

index 8b2b2dc36a9e5bd7ff41c864a2ef33a21f5d4626..7959f65647b93621e6aa666c5ec51f805bc818b3 100644 (file)
@@ -364,18 +364,12 @@ add_subdirectory(lib/Archive)
 add_subdirectory(projects)
 
 option(LLVM_BUILD_TOOLS "Build LLVM tool programs." ON)
-option(LLVM_INCLUDE_TOOLS
-  "Include LLVM tool programs as an available target." ON)
 add_subdirectory(tools)
 
 option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
-option(LLVM_INCLUDE_EXAMPLES
-  "Include LLVM example programs as an available target." OFF)
 add_subdirectory(examples)
 
 option(LLVM_BUILD_TESTS "Build LLVM unit tests." OFF)
-option(LLVM_INCLUDE_TESTS
-  "Include LLVM unit tests as an available target." OFF)
 add_subdirectory(test)
 add_subdirectory(utils/unittest)
 add_subdirectory(unittests)
index 699754f6a2bda8abd02528a48fdbc45b3b03d303..22a456e460c591fdb3e93d4c589fd56e03f56f62 100755 (executable)
@@ -77,9 +77,7 @@ macro(add_llvm_tool name)
   if( NOT LLVM_BUILD_TOOLS )
     set(EXCLUDE_FROM_ALL ON)
   endif()
-  if( LLVM_INCLUDE_TOOLS OR LLVM_BUILD_TOOLS )
-    add_llvm_executable(${name} ${ARGN})
-  endif()
+  add_llvm_executable(${name} ${ARGN})
   if( LLVM_BUILD_TOOLS )
     install(TARGETS ${name} RUNTIME DESTINATION bin)
   endif()
@@ -91,9 +89,7 @@ macro(add_llvm_example name)
   if( NOT LLVM_BUILD_EXAMPLES )
     set(EXCLUDE_FROM_ALL ON)
   endif()
-  if( LLVM_INCLUDE_EXAMPLES OR LLVM_BUILD_EXAMPLES )
-    add_llvm_executable(${name} ${ARGN})
-  endif()
+  add_llvm_executable(${name} ${ARGN})
   if( LLVM_BUILD_EXAMPLES )
     install(TARGETS ${name} RUNTIME DESTINATION examples)
   endif()
index ab4d53c90bb4f75043052b67e34eb099302b07df..595ec21454eb92d28cee7c584ca0873f92b11652 100644 (file)
@@ -9,9 +9,7 @@ function(add_llvm_unittest test_name)
   if( NOT LLVM_BUILD_TESTS )
     set(EXCLUDE_FROM_ALL ON)
   endif()
-  if (LLVM_INCLUDE_TESTS OR LLVM_BUILD_TESTS)
-    add_llvm_executable(${test_name}Tests ${ARGN})
-  endif()
+  add_llvm_executable(${test_name}Tests ${ARGN})
 endfunction()
 
 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
index 99741c8f056e28479f9da5a28857d3f37c635c4e..7068546301439f9a4c975147c2ee0d9c882693e1 100644 (file)
@@ -20,17 +20,15 @@ if(WIN32)
   add_definitions(-DGTEST_OS_WINDOWS=1)
 endif()
 
-if (LLVM_INCLUDE_TESTS OR LLVM_BUILD_TESTS)
-  add_llvm_library(gtest
-    googletest/gtest.cc
-    googletest/gtest-death-test.cc
-    googletest/gtest-filepath.cc
-    googletest/gtest-port.cc
-    googletest/gtest-test-part.cc
-    googletest/gtest-typed-test.cc
-    )
+add_llvm_library(gtest
+  googletest/gtest.cc
+  googletest/gtest-death-test.cc
+  googletest/gtest-filepath.cc
+  googletest/gtest-port.cc
+  googletest/gtest-test-part.cc
+  googletest/gtest-typed-test.cc
+  )
 
-  add_llvm_library(gtest_main
-    UnitTestMain/TestMain.cpp
-    )
-endif()
+add_llvm_library(gtest_main
+  UnitTestMain/TestMain.cpp
+  )