[flang-commits] [flang] [llvm] [flang/flang-rt] Add -isysroot flag only to tests really requiring (PR #152914)
via flang-commits
flang-commits at lists.llvm.org
Mon Aug 11 02:52:57 PDT 2025
================
@@ -0,0 +1,13 @@
+from lit.llvm import llvm_config
+
+llvm_config.use_clang(required=False)
+if llvm_config.config.clang:
+ config.available_features.add("clang")
+ clangxx = next((subst for subst in llvm_config.config.substitutions
+ if "clangxx" in subst[0]), None)
+ config.substitutions.append(clangxx)
+
+# Include path for C headers that define Flang's Fortran ABI.
+config.substitutions.append(
+ ("%include", os.path.join(config.flang_source_dir, "include"))
----------------
parabola94 wrote:
It would be necessary when building flang standalone.
```
/path/to/build/bin/clang --driver-mode=g++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk -I %include/flang /path/to/llvm-project/flang/test/Integration/iso-fortran-binding.cpp -o /path/to/build2/flang/test/Integration/Output/iso-fortran-binding.cpp.tmp/a.out # RUN: at line 4
+ /path/to/build/bin/clang --driver-mode=g++ -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk -I %include/flang /path/to/llvm-project/flang/test/Integration/iso-fortran-binding.cpp -o /path/to/build2/flang/test/Integration/Output/iso-fortran-binding.cpp.tmp/a.out
/path/to/llvm-project/flang/test/Integration/iso-fortran-binding.cpp:8:10: fatal error: 'ISO_Fortran_binding.h' file not found
8 | #include "ISO_Fortran_binding.h"
| ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
--
```
`/path/to/build/bin/clang++` does not search `/path/to/build2/lib/clang/22/include`.
https://github.com/llvm/llvm-project/pull/152914
More information about the flang-commits
mailing list