File: apple-libc%2B%2B-shared.cfg.in

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (51 lines) | stat: -rw-r--r-- 2,078 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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.
#
# Finally, we also link against an artificial shims library that provides
# the functionality necessary for the upstream libc++ to be usable in place
# of a system-provided libc++. Without that, attempting to replace the system
# libc++ with DYLD_LIBRARY_PATH would result in missing symbols and other similar
# issues since the upstream libc++ does not contain all the symbols provided by
# the system library.

lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')

import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
ADDITIONAL_PARAMETERS = [
    libcxx.test.dsl.Parameter(name='apple_system_shims', type=str,
        actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{apple-system-shims}', path)],
        help="""
        Path to a pre-built object file or static archive that contains shims necessary to
        allow replacing the system libc++ by the just-built one.
        """),
]

config.substitutions.append(('%{flags}',
    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
    '-nostdlib++ -L %{lib-dir} -lc++ %{apple-system-shims}'
))
config.substitutions.append(('%{exec}',
    '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib-dir} -- '
))

config.stdlib = 'apple-libc++'

libcxx.test.config.configure(
    libcxx.test.params.DEFAULT_PARAMETERS + ADDITIONAL_PARAMETERS,
    libcxx.test.features.DEFAULT_FEATURES,
    config,
    lit_config
)