From 1932c06fe515a9e8595f082f53f730ca271ffc15 Mon Sep 17 00:00:00 2001 From: otavepto <153766569+otavepto@users.noreply.github.com> Date: Tue, 28 May 2024 04:08:04 +0300 Subject: [PATCH] fix overlay compilation on MinGW, now everything compiles everywhere! --- premake5-deps.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/premake5-deps.lua b/premake5-deps.lua index 542551b0..140e83a0 100644 --- a/premake5-deps.lua +++ b/premake5-deps.lua @@ -618,30 +618,37 @@ if _OPTIONS["build-ingame_overlay"] or _OPTIONS["all-build"] then 'INGAMEOVERLAY_BUILD_TESTS=OFF', } -- fix missing standard include/header file for gcc/clang - local ingame_overlay_missing_inc = {} + local ingame_overlay_fixes = {} if string.match(_ACTION, 'gmake.*') then - ingame_overlay_missing_inc = { + ingame_overlay_fixes = { '-include cstdint', '-include cinttypes', } + -- MinGW fixes + if os.target() == 'windows' then + -- MinGW throws this error: Library.cpp:77:26: error: invalid conversion from 'FARPROC' {aka 'long long int (*)()'} to 'void*' [-fpermissive] + table.insert(ingame_overlay_fixes, '-fpermissive') + -- MinGW throws this error: Filesystem.cpp:139:38: error: no matching function for call to 'stat::stat(const char*, stat*) + table.insert(ingame_overlay_fixes, '-include sys/stat.h') + end end if _OPTIONS["32-build"] then cmake_build('ingame_overlay/deps/System', true, { 'BUILD_SYSTEMLIB_TESTS=OFF', - }, nil, ingame_overlay_missing_inc) + }, nil, ingame_overlay_fixes) cmake_build('ingame_overlay/deps/mini_detour', true, { 'BUILD_MINIDETOUR_TESTS=OFF', }) - cmake_build('ingame_overlay', true, ingame_overlay_common_defs, nil, ingame_overlay_missing_inc) + cmake_build('ingame_overlay', true, ingame_overlay_common_defs, nil, ingame_overlay_fixes) end if _OPTIONS["64-build"] then cmake_build('ingame_overlay/deps/System', false, { 'BUILD_SYSTEMLIB_TESTS=OFF', - }, nil, ingame_overlay_missing_inc) + }, nil, ingame_overlay_fixes) cmake_build('ingame_overlay/deps/mini_detour', false, { 'BUILD_MINIDETOUR_TESTS=OFF', }) - cmake_build('ingame_overlay', false, ingame_overlay_common_defs, nil, ingame_overlay_missing_inc) + cmake_build('ingame_overlay', false, ingame_overlay_common_defs, nil, ingame_overlay_fixes) end end