proper link/build options for MinGW + reorder them for consistency

This commit is contained in:
otavepto 2024-05-28 22:29:00 +03:00
parent 6bba1efc9e
commit 5863d61665

View File

@ -418,19 +418,10 @@ filter {} -- reset the filter and remove all active keywords
-- MinGw on Windows -- MinGw on Windows
--------- ---------
-- MinGw on Windows common compiler/linker options
filter { "system:windows", "action:gmake*", } filter { "system:windows", "action:gmake*", }
buildoptions { -- MinGw on Windows common compiler/linker options
-- MinGw on Windows cannot compile 'creatwth.cpp' from Detours lib (error: 'DWordMult' was not declared in this scope)
-- because intsafe.h isn't included by default
"-include intsafe.h",
}
-- source: https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html -- source: https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html
linkoptions { buildoptions {
-- I don't know why but if libgcc/libstdc++ as well as pthreads are not statically linked
-- none of the output binary .dlls will reach their DllMain() in x64dbg
-- even when they're force-loaded in any process they immediately unload
"-static",
-- from docs: "specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor, -- from docs: "specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor,
-- but does not influence the choice of runtime library/startup code" -- but does not influence the choice of runtime library/startup code"
-- optional really -- optional really
@ -445,14 +436,12 @@ filter { "system:windows", "action:gmake*", }
-- '_CRT_NONSTDC_NO_WARNINGS', -- '_CRT_NONSTDC_NO_WARNINGS',
'_CRT_DECLARE_NONSTDC_NAMES', '_CRT_DECLARE_NONSTDC_NAMES',
} }
-- MinGw on Windows common libs to link linkoptions {
-- links { -- I don't know why but if libgcc/libstdc++ as well as pthreads are not statically linked
-- -- CoreLibraryDependencies, copied from VS 2022 -- none of the output binary .dlls will reach their DllMain() in x64dbg
-- "kernel32", "user32", "gdi32", "winspool", "comdlg32", "advapi32", "shell32", "ole32", "oleaut32", "uuid", "odbc32", "odbccp32", -- even when they're force-loaded in any process they immediately unload
-- 'Xinput', "-static",
-- -- 'mingw32', 'gcc', 'msvcrt', 'mingwex', }
-- 'ucrt', 'libstdc++',
-- }