[all-commits] [llvm/llvm-project] 57ee62: [cmake] Provide CURRENT_TOOLS_DIR centrally, repla...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Mar 25 12:22:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57ee624d7946b4d42890709287eb71d4eb1fa2fa
      https://github.com/llvm/llvm-project/commit/57ee624d7946b4d42890709287eb71d4eb1fa2fa
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

  Changed paths:
    M clang-tools-extra/clangd/test/CMakeLists.txt
    M clang-tools-extra/clangd/test/lit.site.cfg.py.in
    M clang-tools-extra/pseudo/test/CMakeLists.txt
    M clang-tools-extra/pseudo/test/lit.site.cfg.py.in
    M clang-tools-extra/test/CMakeLists.txt
    M clang-tools-extra/test/lit.site.cfg.py.in
    M clang/test/CMakeLists.txt
    M clang/test/lit.site.cfg.py.in
    M clang/utils/perf-training/CMakeLists.txt
    M clang/utils/perf-training/lit.site.cfg.in
    M clang/utils/perf-training/order-files.lit.site.cfg.in
    M lld/test/CMakeLists.txt
    M lld/test/Unit/lit.site.cfg.py.in
    M lld/test/lit.site.cfg.py.in
    M llvm/cmake/modules/AddLLVM.cmake
    M llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn
    M llvm/utils/gn/secondary/clang-tools-extra/pseudo/test/BUILD.gn
    M llvm/utils/gn/secondary/clang-tools-extra/test/BUILD.gn
    M llvm/utils/gn/secondary/clang/test/BUILD.gn
    M llvm/utils/gn/secondary/lld/test/BUILD.gn

  Log Message:
  -----------
  [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR

CLANG_TOOLS_DIR holds the the current bin/ directory, maybe with a %(build_mode)
placeholder. It is used to add the just-built binaries to $PATH for lit tests.
In most cases it equals LLVM_TOOLS_DIR, which is used for the same purpose.
But for a standalone build of clang, CLANG_TOOLS_DIR points at the build tree
and LLVM_TOOLS_DIR points at the provided LLVM binaries.

Currently CLANG_TOOLS_DIR is set in clang/test/, clang-tools-extra/test/, and
other things always built with clang. This is a few cryptic lines of CMake in
each place. Meanwhile LLVM_TOOLS_DIR is provided by configure_site_lit_cfg().

This patch moves CLANG_TOOLS_DIR to configure_site_lit_cfg() and renames it:
 - there's nothing clang-specific about the value
 - it will also replace LLD_TOOLS_DIR, LLDB_TOOLS_DIR etc (not in this patch)

It also defines CURRENT_LIBS_DIR. While I removed the last usage of
CLANG_LIBS_DIR in e4cab4e24d1, there are LLD_LIBS_DIR usages etc that
may be live, and I'd like to mechanically update them in a followup patch.

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




More information about the All-commits mailing list