Skip to content

Commit 431507d

Browse files
authored
[libcxxabi][cmake] Account for LIBCXXABI_TARGET_SUBDIR in test config (#138527)
This makes the logic and code structure match that of libc++, which handles this case (i.e. the target subdirectory being changed). The `%{target}` substitution from libc++ is removed as libc++abi's config seems to be the only place it's used.
1 parent 4403123 commit 431507d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

libcxx/utils/libcxx/test/params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def getSuitableClangTidy(cfg):
170170
[
171171
AddFeature("target={}".format(triple)),
172172
AddFlagIfSupported("--target={}".format(triple)),
173-
AddSubstitution("%{triple}", triple),
174173
],
175174
),
176175
),

libcxxabi/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
192192
set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBCXXABI_TARGET_SUBDIR})
193193
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LIBCXXABI_TARGET_SUBDIR} CACHE STRING
194194
"Path where built libc++abi libraries should be installed.")
195+
set(LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LIBCXXABI_TARGET_SUBDIR}/c++/v1" CACHE STRING
196+
"Path where target-specific libc++abi headers should be installed.")
195197
unset(LIBCXXABI_TARGET_SUBDIR)
196198
else()
197199
if(LLVM_LIBRARY_OUTPUT_INTDIR)
@@ -203,6 +205,8 @@ else()
203205
endif()
204206
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE STRING
205207
"Path where built libc++abi libraries should be installed.")
208+
set(LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR "${LIBCXXABI_INSTALL_INCLUDE_DIR}" CACHE STRING
209+
"Path where target-specific libc++abi headers should be installed.")
206210
endif()
207211

208212
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})

libcxxabi/test/configs/cmake-bridge.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ config.substitutions.append(('%{llvm}', '@LLVM_MAIN_SRC_DIR@'))
3232
config.substitutions.append(('%{install-prefix}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@'))
3333
config.substitutions.append(('%{include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/include'))
3434
config.substitutions.append(('%{cxx-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_INCLUDE_DIR@'))
35-
config.substitutions.append(('%{cxx-target-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/include/%{triple}/c++/v1'))
35+
config.substitutions.append(('%{cxx-target-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR@'))
3636
config.substitutions.append(('%{lib}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_LIBRARY_DIR@'))
3737
config.substitutions.append(('%{benchmark_flags}', ''))
3838

0 commit comments

Comments
 (0)