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