Skip to content

Commit 5d942f2

Browse files
committed
[CMake] Import CLANG_TOOLS_DIR from check-clang into check-clang-tools for standalone clang.
llvm-svn: 199583
1 parent e956194 commit 5d942f2

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

clang-tools-extra/test/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
88
set(CLANG_TOOLS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
99

10+
if (CMAKE_CFG_INTDIR STREQUAL ".")
11+
set(LLVM_BUILD_MODE ".")
12+
else ()
13+
set(LLVM_BUILD_MODE "%(build_mode)s")
14+
endif ()
15+
16+
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${CLANG_RUNTIME_OUTPUT_INTDIR})
17+
1018
configure_lit_site_cfg(
1119
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
1220
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg

clang-tools-extra/test/lit.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ for name in possibly_dangerous_env_vars:
7979

8080
# Tweak the PATH to include the tools dir and the scripts dir.
8181
if clang_tools_binary_dir is not None:
82+
clang_tools_dir = getattr(config, 'clang_tools_dir', None)
83+
if not clang_tools_dir:
84+
lit_config.fatal('No Clang tools dir set!')
8285
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
8386
if not llvm_tools_dir:
8487
lit_config.fatal('No LLVM tools dir set!')
85-
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
88+
path = os.path.pathsep.join((
89+
clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
8690
config.environment['PATH'] = path
8791

8892
llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)

clang-tools-extra/test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
88
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
99
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
1010
config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
11+
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
1112
config.target_triple = "@TARGET_TRIPLE@"
1213
config.have_libedit = "@HAVE_LIBEDIT@"
1314

0 commit comments

Comments
 (0)