From 154d8e4b1c07c5fa4f0c12303a9c2a38aa3a36b3 Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 15 Apr 2024 09:38:32 -0400 Subject: [PATCH] Fix test program linkage for cross-compiling --- tests/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c59657f64..eb297a804 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -105,6 +105,14 @@ endif() add_executable(kat_sig_stfl kat_sig_stfl.c test_helpers.c) target_link_libraries(kat_sig_stfl PRIVATE ${TEST_DEPS}) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND BUILD_SHARED_LIBS) + # workaround for Windows .dll + if(CMAKE_CROSSCOMPILING) + target_link_options(kat_sig_stfl PRIVATE -Wl,--allow-multiple-definition) + else() + target_link_options(kat_sig_stfl PRIVATE "/FORCE:MULTIPLE") + endif() +endif() add_executable(test_sig test_sig.c) target_link_libraries(test_sig PRIVATE ${TEST_DEPS})