From 7e52ffe95686b10b668da0f67a6e4b929f6ed183 Mon Sep 17 00:00:00 2001 From: kokokoshka Date: Tue, 15 Jun 2021 10:36:55 +0300 Subject: [PATCH] MinGW support --- CMakeLists.txt | 6 +++++- src/core/os_win32.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64550687..4981c98a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -595,7 +595,11 @@ endforeach() if(WIN32) target_sources(lovr PRIVATE src/core/os_win32.c) target_sources(lovr PRIVATE src/resources/lovr.rc) - set_target_properties(lovr PROPERTIES COMPILE_FLAGS "/wd4244 /MP") + if (MSVC) + set_target_properties(lovr PROPERTIES COMPILE_FLAGS "/wd4244 /MP") + else() + set_target_properties(lovr PROPERTIES COMPILE_FLAGS "-MP") + endif() set_target_properties(lovr PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:console /ENTRY:WinMainCRTStartup") set_target_properties(lovr PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:windows /ENTRY:WinMainCRTStartup") target_compile_definitions(lovr PRIVATE _CRT_SECURE_NO_WARNINGS) diff --git a/src/core/os_win32.c b/src/core/os_win32.c index ee96dfdd..867d4bd5 100644 --- a/src/core/os_win32.c +++ b/src/core/os_win32.c @@ -2,8 +2,8 @@ #define WIN32_LEAN_AND_MEAN #include #include -#include -#include +#include +#include #include #include "os_glfw.h"