52 lines · plain
1#2# Configuration file for running the libunwind tests against the static library.3#4 5lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')6 7compile_flags = []8link_flags = []9 10if @LIBUNWIND_ENABLE_THREADS@:11 link_flags.append('-lpthread')12 13if @LIBUNWIND_ENABLE_CET@:14 compile_flags.append('-fcf-protection=full')15 16if @LIBUNWIND_ENABLE_GCS@:17 compile_flags.append('-mbranch-protection=standard')18 19# On ELF platforms, link tests with -Wl,--export-dynamic if supported by the linker.20if len('@CMAKE_EXE_EXPORTS_CXX_FLAG@'):21 link_flags.append('@CMAKE_EXE_EXPORTS_CXX_FLAG@')22 23if '@CMAKE_DL_LIBS@':24 link_flags.append('-l@CMAKE_DL_LIBS@')25 26# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.27compile_flags.append('-funwind-tables')28 29local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'30config.substitutions.append(('%{flags}',31 '-isysroot {}'.format(local_sysroot) if local_sysroot else ''32))33config.substitutions.append(('%{compile_flags}',34 '-nostdinc++ -I %{{include}} {}'.format(' '.join(compile_flags))35))36config.substitutions.append(('%{link_flags}',37 '%{{lib}}/libunwind.a {}'.format(' '.join(link_flags))38))39config.substitutions.append(('%{exec}',40 '%{executor} --execdir %{temp} -- '41))42 43import os, site44site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))45import libcxx.test.params, libcxx.test.config46libcxx.test.config.configure(47 libcxx.test.params.DEFAULT_PARAMETERS,48 libcxx.test.features.DEFAULT_FEATURES,49 config,50 lit_config51)52