From 599bcb5cf1ea524a6636949726f0724bb3537425 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Thu, 8 Aug 2024 01:30:39 +0000 Subject: [PATCH] run-make: enable msvc for redundant-libs --- tests/run-make/redundant-libs/foo.c | 10 ++++++++-- tests/run-make/redundant-libs/rmake.rs | 6 ------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/run-make/redundant-libs/foo.c b/tests/run-make/redundant-libs/foo.c index 339ee86c99e..551b85d1824 100644 --- a/tests/run-make/redundant-libs/foo.c +++ b/tests/run-make/redundant-libs/foo.c @@ -1,2 +1,8 @@ -void foo1() {} -void foo2() {} +#ifdef _MSC_VER +#define DllExport __declspec(dllexport) +#else +#define DllExport +#endif + +DllExport void foo1() {} +DllExport void foo2() {} diff --git a/tests/run-make/redundant-libs/rmake.rs b/tests/run-make/redundant-libs/rmake.rs index fb1b3bca8ad..43bb30bde70 100644 --- a/tests/run-make/redundant-libs/rmake.rs +++ b/tests/run-make/redundant-libs/rmake.rs @@ -10,12 +10,6 @@ //@ ignore-cross-compile // Reason: the compiled binary is executed -//@ ignore-windows-msvc -// Reason: this test links libraries via link.exe, which only accepts the import library -// for the dynamic library, i.e. `foo.dll.lib`. However, build_native_dynamic_lib only -// produces `foo.dll` - the dynamic library itself. To make this test work on MSVC, one -// would need to derive the import library from the dynamic library. -// See https://stackoverflow.com/questions/9360280/ use run_make_support::{ build_native_dynamic_lib, build_native_static_lib, cwd, is_msvc, rfs, run, rustc,