[clang] b4adb42 - Use setup_host_tool for clang-ast-dump, fixes 76707

Jon Chesterfield via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 15:24:10 PDT 2024


Author: Jon Chesterfield
Date: 2024-04-02T23:21:48+01:00
New Revision: b4adb42151bbfa80be4cf6d076cbe5edf680693e

URL: https://github.com/llvm/llvm-project/commit/b4adb42151bbfa80be4cf6d076cbe5edf680693e
DIFF: https://github.com/llvm/llvm-project/commit/b4adb42151bbfa80be4cf6d076cbe5edf680693e.diff

LOG: Use setup_host_tool for clang-ast-dump, fixes 76707

Added: 
    

Modified: 
    clang/lib/Tooling/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index 91e6cbdcbc44f7..8b4ab0e2129649 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -53,14 +53,16 @@ else()
     list(APPEND implicitDirs -I ${implicitDir})
   endforeach()
 
+  setup_host_tool(clang-ast-dump CLANG_AST_DUMP clang_ast_dump_exe clang_ast_dump_target)
+
   include(GetClangResourceDir)
   get_clang_resource_dir(resource_dir PREFIX ${LLVM_BINARY_DIR})
   add_custom_command(
       COMMENT Generate ASTNodeAPI.json
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
-      DEPENDS clang-ast-dump clang-resource-headers
+      DEPENDS ${clang_ast_dump_target} clang-resource-headers
       COMMAND
-      $<TARGET_FILE:clang-ast-dump>
+      ${clang_ast_dump_exe}
         # Skip this in debug mode because parsing AST.h is too slow
         --skip-processing=${skip_expensive_processing}
         -I ${resource_dir}/include


        


More information about the cfe-commits mailing list