1 # Testing configuration for Apple's system libc++.
3 # This configuration differs from a normal LLVM shared library configuration in
4 # that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library,
5 # since Apple's libc++ has an absolute install_name.
7 # We also don't use a per-target include directory layout, so we have only one
8 # include directory for the libc++ headers.
10 # Finally, we also link against an artificial shims library that provides
11 # the functionality necessary for the upstream libc++ to be usable in place
12 # of a system-provided libc++. Without that, attempting to replace the system
13 # libc++ with DYLD_LIBRARY_PATH would result in missing symbols and other similar
14 # issues since the upstream libc++ does not contain all the symbols provided by
17 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
20 site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
21 import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
22 ADDITIONAL_PARAMETERS = [
23 libcxx.test.dsl.Parameter(name='apple_system_shims', type=str,
24 actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{apple-system-shims}', path)],
26 Path to a pre-built object file or static archive that contains shims necessary to
27 allow replacing the system libc++ by the just-built one.
31 config.substitutions.append(('%{flags}',
32 '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
34 config.substitutions.append(('%{compile_flags}',
35 '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
37 config.substitutions.append(('%{link_flags}',
38 '-nostdlib++ -L %{lib-dir} -lc++ %{apple-system-shims}'
40 config.substitutions.append(('%{exec}',
41 '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib-dir} -- '
44 config.stdlib = 'apple-libc++'
46 libcxx.test.config.configure(
47 libcxx.test.params.DEFAULT_PARAMETERS + ADDITIONAL_PARAMETERS,
48 libcxx.test.features.DEFAULT_FEATURES,