Skip to content

Commit

Permalink
[libunwind] [test] Add a mingw specific test config file
Browse files Browse the repository at this point in the history
This matches how it is done for libcxx and libcxxabi.

Differential Revision: https://reviews.llvm.org/D147633
  • Loading branch information
mstorsjo committed Apr 6, 2023
1 parent a33d5a9 commit b25e989
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ if(LIBUNWIND_SYSROOT OR LIBUNWIND_TARGET_TRIPLE OR LIBUNWIND_GCC_TOOLCHAIN)
message(WARNING "LIBUNWIND_SYSROOT, LIBUNWIND_TARGET_TRIPLE and LIBUNWIND_GCC_TOOLCHAIN are not supported anymore, please use the native CMake equivalents instead")
endif()

if (LIBUNWIND_ENABLE_SHARED)
if(MINGW)
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-mingw.cfg.in")
elseif (LIBUNWIND_ENABLE_SHARED)
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-shared.cfg.in")
else()
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-static.cfg.in")
Expand Down
25 changes: 25 additions & 0 deletions libunwind/test/configs/llvm-libunwind-mingw.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This testing configuration handles running the test suite against LLVM's libunwind
# using either a DLL or a static library, with MinGW/Clang on Windows.

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

config.substitutions.append(('%{flags}', ''))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I %{include} -funwind-tables'
))
config.substitutions.append(('%{link_flags}',
'-L %{lib} -lunwind'
))
config.substitutions.append(('%{exec}',
'%{executor} --execdir %T --env PATH=%{lib} -- '
))

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

0 comments on commit b25e989

Please sign in to comment.