Turn CLANG_ENABLE_{ARCMT,REWRITER,STATIC_ANALYZER} into proper options so that
users can disable those. Just like in autoconf generated makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182881 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 334ea41..fed775e 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -9,10 +9,14 @@
   add_unittest(ClangUnitTests ${test_dirname} ${ARGN})
 endfunction()
 
-add_subdirectory(ASTMatchers)
-add_subdirectory(AST)
 add_subdirectory(Basic)
 add_subdirectory(Lex)
-add_subdirectory(Frontend)
-add_subdirectory(Tooling)
-add_subdirectory(Format)
+if(CLANG_ENABLE_STATIC_ANALYZER)
+  add_subdirectory(Frontend)
+endif()
+if(CLANG_ENABLE_REWRITER)
+  add_subdirectory(ASTMatchers)
+  add_subdirectory(AST)
+  add_subdirectory(Tooling)
+  add_subdirectory(Format)
+endif()