r185548 - With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.

Jordan Rose jordan_rose at apple.com
Wed Jul 3 09:20:29 PDT 2013


Author: jrose
Date: Wed Jul  3 11:20:29 2013
New Revision: 185548

URL: http://llvm.org/viewvc/llvm-project?rev=185548&view=rev
Log:
With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.

Previously, the CMake build still tried to link clang against the static
analyzer libraries, even if CLANG_ENABLE_STATIC_ANALYZER was off.
Furthermore, clang-check depends on the analyzer, so it should be disabled
(in both CMake and configure builds).

In theory, clang-check could be made to conditionally include analyzer
support (like clang itself), but for now this at least gets a CMake ALL_BUILD
working.

Patch by Stephen Kelly, modified by me.

Modified:
    cfe/trunk/lib/FrontendTool/CMakeLists.txt
    cfe/trunk/tools/CMakeLists.txt
    cfe/trunk/tools/Makefile

Modified: cfe/trunk/lib/FrontendTool/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/CMakeLists.txt?rev=185548&r1=185547&r2=185548&view=diff
==============================================================================
--- cfe/trunk/lib/FrontendTool/CMakeLists.txt (original)
+++ cfe/trunk/lib/FrontendTool/CMakeLists.txt Wed Jul  3 11:20:29 2013
@@ -14,8 +14,13 @@ target_link_libraries(clangFrontendTool
   clangRewriteCore
   clangRewriteFrontend
   clangCodeGen
-  clangStaticAnalyzerFrontend
-  clangStaticAnalyzerCheckers
-  clangStaticAnalyzerCore
   clangARCMigrate
   )
+
+if(CLANG_ENABLE_STATIC_ANALYZER)
+  target_link_libraries(clangFrontendTool
+    clangStaticAnalyzerFrontend
+    clangStaticAnalyzerCheckers
+    clangStaticAnalyzerCore
+    )
+endif()

Modified: cfe/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CMakeLists.txt?rev=185548&r1=185547&r2=185548&view=diff
==============================================================================
--- cfe/trunk/tools/CMakeLists.txt (original)
+++ cfe/trunk/tools/CMakeLists.txt Wed Jul  3 11:20:29 2013
@@ -4,7 +4,9 @@ add_subdirectory(arcmt-test)
 add_subdirectory(c-arcmt-test)
 add_subdirectory(diagtool)
 add_subdirectory(driver)
-add_subdirectory(clang-check)
+if(CLANG_ENABLE_STATIC_ANALYZER)
+  add_subdirectory(clang-check)
+endif()
 add_subdirectory(clang-format)
 
 # We support checking out the clang-tools-extra repository into the 'extra'

Modified: cfe/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/Makefile?rev=185548&r1=185547&r2=185548&view=diff
==============================================================================
--- cfe/trunk/tools/Makefile (original)
+++ cfe/trunk/tools/Makefile Wed Jul  3 11:20:29 2013
@@ -12,7 +12,11 @@ CLANG_LEVEL := ..
 include $(CLANG_LEVEL)/../../Makefile.config
 
 DIRS := libclang c-index-test arcmt-test c-arcmt-test
-PARALLEL_DIRS := driver diagtool clang-check clang-format
+PARALLEL_DIRS := driver diagtool clang-format
+
+ifeq ($(ENABLE_CLANG_STATIC_ANALYZER),1)
+  PARALLEL_DIRS += clang-check
+endif
 
 # Recurse into the extra repository of tools if present.
 OPTIONAL_PARALLEL_DIRS := extra





More information about the cfe-commits mailing list