From 986f77fa159c960c83addd5e656a98fd046f20e7 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Fri, 25 Feb 2022 10:28:22 +0100 Subject: [PATCH] Tests: link with `-static` on MinGW --- extras/CompileOptions.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extras/CompileOptions.cmake b/extras/CompileOptions.cmake index 3421ba06..e083ff9e 100644 --- a/extras/CompileOptions.cmake +++ b/extras/CompileOptions.cmake @@ -92,3 +92,9 @@ if(MSVC) ) endif() endif() + +if(MINGW) + # Static link on MinGW to avoid linking with the wrong DLLs when multiple + # versions are installed. + add_link_options(-static) +endif()