Index: polly/trunk/CMakeLists.txt =================================================================== --- polly/trunk/CMakeLists.txt +++ polly/trunk/CMakeLists.txt @@ -24,6 +24,7 @@ endif() # Enable unit tests if available. + set(POLLY_GTEST_AVAIL 0) set(UNITTEST_DIR ${LLVM_SOURCE_ROOT}/utils/unittest) if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h) # The build tree already exports the gtest target, which we can reuse Index: polly/trunk/test/CMakeLists.txt =================================================================== --- polly/trunk/test/CMakeLists.txt +++ polly/trunk/test/CMakeLists.txt @@ -62,12 +62,12 @@ set_target_properties(check-polly-tests PROPERTIES FOLDER "Polly") add_dependencies(check-polly check-polly-tests) -if (POLLY_GTEST_AVAIL) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg - ) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg + ) +if (POLLY_GTEST_AVAIL) # Run only unit tests add_lit_testsuite(check-polly-unittests "Running polly unit tests only" ${CMAKE_CURRENT_BINARY_DIR}/Unit Index: polly/trunk/test/Unit/lit.cfg =================================================================== --- polly/trunk/test/Unit/lit.cfg +++ polly/trunk/test/Unit/lit.cfg @@ -11,6 +11,9 @@ # name: The name of this test suite. config.name = 'Polly-Unit' +if not config.has_unittests: + raise SystemExit + # suffixes: A list of file extensions to treat as test files. config.suffixes = [] Index: polly/trunk/test/Unit/lit.site.cfg.in =================================================================== --- polly/trunk/test/Unit/lit.site.cfg.in +++ polly/trunk/test/Unit/lit.site.cfg.in @@ -14,6 +14,7 @@ config.target_triple = "@TARGET_TRIPLE@" config.enable_gpgpu_codegen = "@GPU_CODEGEN@" config.link_polly_into_tools = "@LINK_POLLY_INTO_TOOLS@" +config.has_unittests = @POLLY_GTEST_AVAIL@ # Support substitution of the tools_dir, libs_dirs, and build_mode with user # parameters. This is used when we can't determine the tool dir at