1 # Testing configuration for back-deployment against older Apple system libc++abi.
3 # Under this configuration, we compile and link all the test suite against the latest libc++abi,
4 # however we run against the libc++abi on a different platform. This emulates the workflow of
5 # a developer building their application using recent tools but with the goal of deploying
6 # on existing devices running an older OS (and hence an older dylib).
9 site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
10 import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
12 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
14 BACKDEPLOYMENT_PARAMETERS = [
15 libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
16 actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
18 The simulated root of the system (for libc++) when running tests.
20 This should be a directory hierarchy under which the libc++ dylib can be found.
21 The dylib in that hierarchy is the one that will be used at runtime when running
24 libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
25 actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
27 The simulated root of the system (for libc++abi) when running tests.
29 This should be a directory hierarchy under which the libc++abi dylib can be found.
30 The dylib in that hierarchy is the one that will be used at runtime when running
33 libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
34 actions=lambda root: [libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
36 The simulated root of the system (for libunwind) when running tests.
38 This should be a directory hierarchy under which the libunwind dylib can be found.
39 The dylib in that hierarchy is the one that will be used at runtime when running
44 config.substitutions.append(('%{flags}',
45 '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
47 config.substitutions.append(('%{compile_flags}',
48 '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' +
49 '-I %{libcxx}/test/support -I %{libcxx}/src'
51 config.substitutions.append(('%{link_flags}',
52 '-nostdlib++ -L %{lib} -lc++ -lc++abi'
54 config.substitutions.append(('%{exec}',
55 '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
58 config.stdlib = 'apple-libc++'
60 libcxx.test.config.configure(
61 libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
62 libcxx.test.features.DEFAULT_FEATURES,