[clang] [analyzer] Fix tests broken by empty %z3_include_dir (PR #146042)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 27 03:29:23 PDT 2025


================
@@ -173,13 +173,16 @@ def have_host_clang_repl_cuda():
     config.available_features.add("staticanalyzer")
     tools.append("clang-check")
 
+    I_z3_include_dir = ""
     if config.clang_staticanalyzer_z3:
         config.available_features.add("z3")
-        config.substitutions.append(
-            ("%z3_include_dir", config.clang_staticanalyzer_z3_include_dir)
-        )
+        if config.clang_staticanalyzer_z3_include_dir:
----------------
NagyDonat wrote:

> Shouldn't the presence of `config.clang_staticanalyzer_z3` imply the presence of `config.clang_staticanalyzer_z3_include_dir`?

This is what I would've assumed, but the build failure reported by @mgorny strongly suggests that this is not always true. My current suspicion is that if Z3 is installed in some standard include directory, then the clang build system autodetects that Z3 is available (it tries to compile a simple C source file, and that experiment succeeds if Z3 is available in the default include path), but somehow doesn't determine Z3_INCLUDE_DIR.

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


More information about the cfe-commits mailing list