brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · a361b2b Raw
52 lines · plain
1# Testing configuration for Apple's system libc++.2#3# This configuration differs from a normal LLVM shared library configuration in4# 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.6#7# We also don't use a per-target include directory layout, so we have only one8# include directory for the libc++ headers.9#10# Finally, we also link against an artificial shims library that provides11# the functionality necessary for the upstream libc++ to be usable in place12# of a system-provided libc++. Without that, attempting to replace the system13# libc++ with DYLD_LIBRARY_PATH would result in missing symbols and other similar14# issues since the upstream libc++ does not contain all the symbols provided by15# the system library.16 17lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')18 19import os, site20site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))21import libcxx.test.params, libcxx.test.config, libcxx.test.dsl22ADDITIONAL_PARAMETERS = [23    libcxx.test.dsl.Parameter(name='apple_system_shims', type=str,24        actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{apple-system-shims}', path)],25        help="""26        Path to a pre-built object file or static archive that contains shims necessary to27        allow replacing the system libc++ by the just-built one.28        """),29]30 31config.substitutions.append(('%{flags}',32    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''33))34config.substitutions.append(('%{compile_flags}',35    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'36))37config.substitutions.append(('%{link_flags}',38    '-nostdlib++ -L %{lib-dir} -lc++ %{apple-system-shims}'39))40config.substitutions.append(('%{exec}',41    '%{executor} --execdir %{temp} --env DYLD_LIBRARY_PATH=%{lib-dir} -- '42))43 44config.stdlib = 'apple-libc++'45 46libcxx.test.config.configure(47    libcxx.test.params.DEFAULT_PARAMETERS + ADDITIONAL_PARAMETERS,48    libcxx.test.features.DEFAULT_FEATURES,49    config,50    lit_config51)52