Issue 76707
Summary Canadian compilation from Linux to Windows clang-ast-dump not using native tool
Labels new issue
Assignees
Reporter trcrsired
    ```
FAILED: tools/clang/lib/Tooling/ASTNodeAPI.json /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling/ASTNodeAPI.json
cd /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling && /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-ast-dump.exe --skip-processing=0 -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/lib/clang/18/include -I /home/cqwrteur/Projects/myllvm/llvm-project/clang/include -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/include -I /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/include -I /home/cqwrteur/Projects/myllvm/llvm-project/llvm/include -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0 -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0/x86_64-w64-mingw32 -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/14.0.0/backward -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/include -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/lib/gcc/x86_64-w64-mingw32/14.0.0/include-fixed -I /home/cqwrteur/toolchains/x86_64-pc-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/include --json-output-path /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/tools/clang/lib/Tooling/ASTNodeAPI.json
run-detectors: unable to find an interpreter for /home/cqwrteur/Projects/myllvm/canadianbuild/x86_64-windows-gnu/llvm-project/bin/clang-ast-dump.exe
[806/5154] Building CXX object tools/clang/lib/Tooling/Dep...obj.clangDependencyScanning.dir/ModuleDepCollector.cpp.obj
ninja: build stopped: subcommand failed.
```
```
diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index aff39e4de13c..b2573c251fab 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -53,6 +53,14 @@ else()
 list(APPEND implicitDirs -I ${implicitDir})
   endforeach()

+ if(NOT DEFINED CLANG_AST_DUMP)
+    if(DEFINED LLVM_NATIVE_TOOL_DIR)
+ set(CLANG_AST_DUMP ${LLVM_NATIVE_TOOL_DIR}/clang-ast-dump)
+ else()
+      set(CLANG_AST_DUMP $<TARGET_FILE:clang-ast-dump>)
+ endif()
+  endif()
+
   include(GetClangResourceDir)
 get_clang_resource_dir(resource_dir PREFIX ${LLVM_BINARY_DIR})
 add_custom_command(
@@ -60,7 +68,7 @@ else()
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
       DEPENDS clang-ast-dump clang-resource-headers
       COMMAND
- $<TARGET_FILE:clang-ast-dump>
+      ${CLANG_AST_DUMP}
         # Skip this in debug mode because parsing AST.h is too slow
 --skip-processing=${skip_expensive_processing}
         -I ${resource_dir}/include
```

Should fix it like this.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to