1 # Testing configuration for back-deployment against older Apple system libc++.
3 # Under this configuration, we compile and link all the test suite against the latest libc++,
4 # however we run against the libc++ 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('@LIBCXX_SOURCE_DIR@', '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 %{libcxx}/test/support'
50 config.substitutions.append(('%{link_flags}',
51 '-nostdlib++ -L %{lib} -lc++'
53 config.substitutions.append(('%{exec}',
54 '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- '
57 config.stdlib = 'apple-libc++'
59 libcxx.test.config.configure(
60 libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
61 libcxx.test.features.DEFAULT_FEATURES,