[clang] e35096a - cmake: configure clang lit to use hmaptool from source directly

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 16 04:09:10 PDT 2022


Author: Matheus Izvekov
Date: 2022-06-16T13:08:50+02:00
New Revision: e35096ae961eb25843f0489847cdb6c1c586ad30

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

LOG: cmake: configure clang lit to use hmaptool from source directly

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

Reviewed By: dyung

Differential Revision: https://reviews.llvm.org/D127943

Added: 
    

Modified: 
    clang/test/lit.cfg.py
    clang/utils/hmaptool/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index bf1fa141fc48b..fd86353c8cc36 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -111,7 +111,7 @@ def have_host_jit_support():
 
 config.substitutions.append(
     ('%hmaptool', "'%s' %s" % (config.python_executable,
-                             os.path.join(config.clang_tools_dir, 'hmaptool'))))
+                             os.path.join(config.clang_src_dir, 'utils', 'hmaptool', 'hmaptool'))))
 
 config.substitutions.append(
     ('%deps-to-rsp',

diff  --git a/clang/utils/hmaptool/CMakeLists.txt b/clang/utils/hmaptool/CMakeLists.txt
index 1b77727fa791b..72915ec665044 100644
--- a/clang/utils/hmaptool/CMakeLists.txt
+++ b/clang/utils/hmaptool/CMakeLists.txt
@@ -1,14 +1,5 @@
-# FIXME: ideally we would just provide CURRENT_TOOLS_DIR globally instead of
-#        computing it just for function(configure_lit_site_cfg)
-set_llvm_build_mode()
-string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" CURRENT_TOOLS_DIR "${LLVM_RUNTIME_OUTPUT_INTDIR}")
-
-add_custom_command(OUTPUT "${CURRENT_TOOLS_DIR}/hmaptool"
-                   COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/hmaptool" "${CURRENT_TOOLS_DIR}"
-                   DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/hmaptool")
-
 install(PROGRAMS hmaptool DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" COMPONENT hmaptool)
-add_custom_target(hmaptool ALL DEPENDS "${CURRENT_TOOLS_DIR}/hmaptool")
+add_custom_target(hmaptool ALL DEPENDS "hmaptool")
 set_target_properties(hmaptool PROPERTIES FOLDER "Utils")
 
 if(NOT LLVM_ENABLE_IDE)


        


More information about the cfe-commits mailing list