[clang] [clang] Only build static analyzer sources if requested (PR #71653)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 8 02:46:34 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

There used to be a patch similar to this on Phabricator. I asked a long time ago if I can pick it up but the author told me they will work on it, which never happened.

IIRC there also was a problem with this simple patch since some other component depends on the static analyzer being built. Let's see what CI says.

---
Full diff: https://github.com/llvm/llvm-project/pull/71653.diff


1 Files Affected:

- (modified) clang/lib/CMakeLists.txt (+3-1) 


``````````diff
diff --git a/clang/lib/CMakeLists.txt b/clang/lib/CMakeLists.txt
index 1526d65795f8adf..e897fbb16c60d78 100644
--- a/clang/lib/CMakeLists.txt
+++ b/clang/lib/CMakeLists.txt
@@ -23,7 +23,9 @@ add_subdirectory(Tooling)
 add_subdirectory(DirectoryWatcher)
 add_subdirectory(Index)
 add_subdirectory(IndexSerialization)
-add_subdirectory(StaticAnalyzer)
+if(CLANG_ENABLE_STATIC_ANALYZER)
+  add_subdirectory(StaticAnalyzer)
+endif()
 add_subdirectory(Format)
 if(CLANG_INCLUDE_TESTS)
   add_subdirectory(Testing)

``````````

</details>


https://github.com/llvm/llvm-project/pull/71653


More information about the cfe-commits mailing list