2021-09-30 02:56:42 +08:00
|
|
|
# Testing configuration for Apple's system libc++.
|
|
|
|
#
|
|
|
|
# This configuration differs from a normal LLVM shared library configuration in
|
|
|
|
# that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library,
|
|
|
|
# since Apple's libc++ has an absolute install_name.
|
|
|
|
#
|
|
|
|
# We also don't use a per-target include directory layout, so we have only one
|
|
|
|
# include directory for the libc++ headers.
|
|
|
|
|
2021-10-01 01:23:39 +08:00
|
|
|
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
|
2021-09-30 02:56:42 +08:00
|
|
|
|
|
|
|
config.substitutions.append(('%{flags}',
|
2021-10-01 01:23:39 +08:00
|
|
|
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
|
2021-09-30 02:56:42 +08:00
|
|
|
))
|
|
|
|
config.substitutions.append(('%{compile_flags}',
|
[libc++] Use -I instead of -isystem to include headers in the test suite
Using -isystem marks the headers as system headers, which means that we
don't actually get all the warnings that we'd normally get if we included
the headers as user headers.
The goal of the test suite is normally to mirror as closely as possible
how users would use the library. Technically, this change goes against
that philosophy, since users should be using `-isystem` (if they ever
need to specify the libc++ path explicitly, which should be a rare
occurence). However, I believe fishing out additional warnings from
the headers provides more value, hence this change. Ideally, we'd be
able to still use `-isystem`, but instruct Clang to still emit warnings
from the libc++ headers (e.g. we could tell Clang to emit warnings in
any file inside `<...>/usr/include/c++/v1`).
Reviewed By: #libc, ldionne, #libc_abi
Spies: Mordante, EricWF, mstorsjo, mgorny, aheejin, arichardson, philnik, jloser, libcxx-commits
Differential Revision: https://reviews.llvm.org/D118616
2022-03-03 19:10:30 +08:00
|
|
|
'-nostdinc++ -I %{install}/include/c++/v1 -I %{libcxx}/test/support'
|
2021-09-30 02:56:42 +08:00
|
|
|
))
|
|
|
|
config.substitutions.append(('%{link_flags}',
|
2021-10-01 01:23:39 +08:00
|
|
|
'-nostdlib++ -L %{install}/lib -lc++'
|
2021-09-30 02:56:42 +08:00
|
|
|
))
|
|
|
|
config.substitutions.append(('%{exec}',
|
2021-12-09 05:29:18 +08:00
|
|
|
'%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{install}/lib -- '
|
2021-09-30 02:56:42 +08:00
|
|
|
))
|
|
|
|
|
2021-10-01 01:23:39 +08:00
|
|
|
import os, site
|
|
|
|
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
|
2021-10-23 04:15:45 +08:00
|
|
|
import libcxx.test.params, libcxx.test.newconfig
|
2021-09-30 02:56:42 +08:00
|
|
|
libcxx.test.newconfig.configure(
|
|
|
|
libcxx.test.params.DEFAULT_PARAMETERS,
|
|
|
|
libcxx.test.features.DEFAULT_FEATURES,
|
|
|
|
config,
|
|
|
|
lit_config
|
|
|
|
)
|