From ebec5a3608ae88d18c792a51c23b81b3d5f6391d Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 24 May 2021 14:21:58 +0200 Subject: [PATCH] cmake: option -mstackrealign on win32 builds --- cmake/DPF-plugin.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/DPF-plugin.cmake b/cmake/DPF-plugin.cmake index 1eeaea7e..779c4631 100644 --- a/cmake/DPF-plugin.cmake +++ b/cmake/DPF-plugin.cmake @@ -503,6 +503,9 @@ function(dpf__add_executable NAME) C_VISIBILITY_PRESET "hidden" CXX_VISIBILITY_PRESET "hidden" VISIBILITY_INLINES_HIDDEN TRUE) + if (MINGW) + target_compile_options("${NAME}" PUBLIC "-mstackrealign") + endif() endfunction() # dpf__add_module @@ -520,6 +523,9 @@ function(dpf__add_module NAME) if ((NOT WIN32 AND NOT APPLE) OR MINGW) target_link_libraries("${NAME}" PRIVATE "-Wl,--no-undefined") endif() + if (MINGW) + target_compile_options("${NAME}" PUBLIC "-mstackrealign") + endif() endfunction() # dpf__add_static_library @@ -534,6 +540,9 @@ function(dpf__add_static_library NAME) C_VISIBILITY_PRESET "hidden" CXX_VISIBILITY_PRESET "hidden" VISIBILITY_INLINES_HIDDEN TRUE) + if (MINGW) + target_compile_options("${NAME}" PUBLIC "-mstackrealign") + endif() endfunction() # dpf__add_plugin_main