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)
if( NOT LLVM_BUILD_TOOLS )
set(EXCLUDE_FROM_ALL ON)
endif()
- add_llvm_executable(${name} ${ARGN})
+ if( LLVM_INCLUDE_TOOLS OR LLVM_BUILD_TOOLS )
+ add_llvm_executable(${name} ${ARGN})
+ endif()
if( LLVM_BUILD_TOOLS )
install(TARGETS ${name} RUNTIME DESTINATION bin)
endif()
if( NOT LLVM_BUILD_EXAMPLES )
set(EXCLUDE_FROM_ALL ON)
endif()
- add_llvm_executable(${name} ${ARGN})
+ if( LLVM_INCLUDE_EXAMPLES OR LLVM_BUILD_EXAMPLES )
+ add_llvm_executable(${name} ${ARGN})
+ endif()
if( LLVM_BUILD_EXAMPLES )
install(TARGETS ${name} RUNTIME DESTINATION examples)
endif()
if( NOT LLVM_BUILD_TESTS )
set(EXCLUDE_FROM_ALL ON)
endif()
- add_llvm_executable(${test_name}Tests ${ARGN})
+ if (LLVM_INCLUDE_TESTS OR LLVM_BUILD_TESTS)
+ add_llvm_executable(${test_name}Tests ${ARGN})
+ endif()
endfunction()
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
add_definitions(-DGTEST_OS_WINDOWS=1)
endif()
-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
- )
+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_main
- UnitTestMain/TestMain.cpp
- )
+ add_llvm_library(gtest_main
+ UnitTestMain/TestMain.cpp
+ )
+endif()