diff options
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ad0557420..d1c8cec176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,10 +279,17 @@ add_subdirectory(examples) # TODO: docs. add_subdirectory(test) -if( LLVM_INCLUDE_TESTS ) - if( NOT CLANG_BUILT_STANDALONE ) - add_subdirectory(unittests) - endif() +option(CLANG_BUILD_TESTS + "Build Clang unit tests. If OFF, just generate build targets." + LLVM_BUILD_TESTS) +option(CLANG_INCLUDE_TESTS + "Generate build targets for the Clang unit tests." + LLVM_INCLUDE_TESTS) + +if( CLANG_INCLUDE_TESTS ) + add_subdirectory(unittests) +elseif( CLANG_BUILD_TESTS ) + message(FATAL_ERROR "CLANG_BUILD_TESTS requires CLANG_INCLUDE_TESTS") endif() # Workaround for MSVS10 to avoid the Dialog Hell |