Skip to content

Commit de4cea3

Browse files
committed
[libcxxabi][cmake] Account for LIBCXXABI_TARGET_SUBDIR in test config
This makes the logic and code structure match that of libc++, which handles this case. The `%{target}` substitution from libc++ is removed as libc++abi's config seems to be the only place it's used.
1 parent 45d96df commit de4cea3

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
@@ -191,6 +191,8 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
191191
set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LIBCXXABI_TARGET_SUBDIR})
192192
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LIBCXXABI_TARGET_SUBDIR} CACHE STRING
193193
"Path where built libc++abi libraries should be installed.")
194+
set(LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LIBCXXABI_TARGET_SUBDIR}/c++/v1" CACHE STRING
195+
"Path where target-specific libc++abi headers should be installed.")
194196
unset(LIBCXXABI_TARGET_SUBDIR)
195197
else()
196198
if(LLVM_LIBRARY_OUTPUT_INTDIR)
@@ -202,6 +204,8 @@ else()
202204
endif()
203205
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE STRING
204206
"Path where built libc++abi libraries should be installed.")
207+
set(LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR "${LIBCXXABI_INSTALL_INCLUDE_DIR}" CACHE STRING
208+
"Path where target-specific libc++abi headers should be installed.")
205209
endif()
206210

207211
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
@@ -30,7 +30,7 @@ config.substitutions.append(('%{libcxx}', '@LIBCXXABI_LIBCXX_PATH@'))
3030
config.substitutions.append(('%{install-prefix}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@'))
3131
config.substitutions.append(('%{include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/include'))
3232
config.substitutions.append(('%{cxx-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_INCLUDE_DIR@'))
33-
config.substitutions.append(('%{cxx-target-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/include/%{triple}/c++/v1'))
33+
config.substitutions.append(('%{cxx-target-include}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_INCLUDE_TARGET_DIR@'))
3434
config.substitutions.append(('%{lib}', '@LIBCXXABI_TESTING_INSTALL_PREFIX@/@LIBCXXABI_INSTALL_LIBRARY_DIR@'))
3535
config.substitutions.append(('%{benchmark_flags}', ''))
3636

0 commit comments

Comments
 (0)