summaryrefslogtreecommitdiff
path: root/libunwind/test/configs/llvm-libunwind-static.cfg.in
blob: a947a5d08f58bbce667a8763b3adc90bc641dcf7 (plain)
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
#
# Configuration file for running the libunwind tests against the static library.
#

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

compile_flags = []
link_flags = []

if @LIBUNWIND_ENABLE_THREADS@:
    link_flags.append('-lpthread')

if @LIBUNWIND_ENABLE_CET@:
    compile_flags.append('-fcf-protection=full')

if '@CMAKE_SYSTEM_NAME@' == 'Linux':
    link_flags.append('-Wl,--export-dynamic')

# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')

local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
config.substitutions.append(('%{flags}',
    '-isysroot {}'.format(local_sysroot) if local_sysroot else ''
))
config.substitutions.append(('%{compile_flags}',
    '-nostdinc++ -I %{{include}} {}'.format(' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
    '%{{lib}}/libunwind.a -ldl {}'.format(' '.join(link_flags))
))
config.substitutions.append(('%{exec}',
    '%{executor} --execdir %T -- '
))

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