File: stdlib-libstdc%2B%2B.cfg.in

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (64 lines) | stat: -rw-r--r-- 2,972 bytes parent folder | download | duplicates (2)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# This testing configuration runs the test suite using the libstdc++ Standard library.
#
# The additional '--param libstdcxx_install_prefix=<PATH>', '--param libstdcxx_triple=<TRIPLE>' and
# '--param libstdcxx_version=<VERSION>' lit parameters must be provided when invoking lit for the
# configuration to find the appropriate headers and library.
#
# For example:
#
#  $ ./libcxx/utils/libcxx-lit <BUILD> -sv libcxx/test/std --param libstdcxx_install_prefix=/opt/homebrew/Cellar/gcc/14.1.0_1 \
#                                                          --param libstdcxx_version=14 \
#                                                          --param libstdcxx_triple=aarch64-apple-darwin22
#

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 for libstdc++
LIBSTDCXX_PARAMETERS = [
    libcxx.test.dsl.Parameter(name='libstdcxx_install_prefix', type=str,
        actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-install-prefix}', path)],
        help="""
        The installation prefix where libstdc++ was installed. This is used to find the libstdc++ headers,
        link against its built library, etc.
        """),
    libcxx.test.dsl.Parameter(name='libstdcxx_triple', type=str,
        actions=lambda triple: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-triple}', triple)],
        help="""
        The target triple used for the target-specific include directory of libstdc++. This is used to find the
        libstdc++ headers.
        """),
    libcxx.test.dsl.Parameter(name='libstdcxx_version', type=str,
        actions=lambda version: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-version}', version)],
        help="""
        The version of libstdc++. This is used to find the libstdc++ headers and library.
        """),
]

# Configure the compiler and flags
config.substitutions.append(('%{flags}',
    '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
))
config.substitutions.append(('%{compile_flags}',
    '-nostdinc++ -isystem %{libstdcxx-install-prefix}/include/c++/%{libstdcxx-version} -isystem %{libstdcxx-install-prefix}/include/c++/%{libstdcxx-version}/%{libstdcxx-triple} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
    '-nostdlib++ -L %{libstdcxx-install-prefix}/lib/gcc/%{libstdcxx-version} -Wl,-rpath,%{libstdcxx-install-prefix}/lib/gcc/%{libstdcxx-version} -lstdc++'
))
config.substitutions.append(('%{exec}',
    '%{executor} --execdir %T -- '
))

import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.params, libcxx.test.config
libcxx.test.config.configure(
    libcxx.test.params.DEFAULT_PARAMETERS + LIBSTDCXX_PARAMETERS,
    libcxx.test.features.DEFAULT_FEATURES,
    config,
    lit_config
)