summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar James Rowe2016-08-01 15:13:35 -0600
committerGravatar James Rowe2016-11-13 23:50:46 -0700
commitc3ea6f4ddb4aeed9663b5039e9ab11a7fef7c395 (patch)
tree282996d714b4c104ae0270ba0c505160b05207d0
parentMerge pull request #2171 from jroweboy/fix-mac-build (diff)
downloadyuzu-c3ea6f4ddb4aeed9663b5039e9ab11a7fef7c395.tar.gz
yuzu-c3ea6f4ddb4aeed9663b5039e9ab11a7fef7c395.tar.xz
yuzu-c3ea6f4ddb4aeed9663b5039e9ab11a7fef7c395.zip
Add mingw compile support
-rw-r--r--CMakeLists.txt11
-rw-r--r--externals/microprofile/microprofile.h4
-rw-r--r--src/citra_qt/main.cpp4
-rw-r--r--src/common/string_util.cpp5
-rw-r--r--src/core/gdbstub/gdbstub.cpp2
5 files changed, 20 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 26dec8f86..56503f1ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
68if (NOT MSVC) 68if (NOT MSVC)
69 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") 69 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
70 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") 70 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
71
72 if (MINGW)
73 add_definitions(-DMINGW_HAS_SECURE_API)
74 if (MINGW_STATIC_BUILD)
75 add_definitions(-DQT_STATICPLUGIN)
76 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
77 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
78 endif()
79 endif()
71else() 80else()
72 # Silence "deprecation" warnings 81 # Silence "deprecation" warnings
73 add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS) 82 add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS)
@@ -175,7 +184,7 @@ IF (APPLE)
175 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") 184 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
176ELSEIF(MINGW) 185ELSEIF(MINGW)
177 # PSAPI is the Process Status API 186 # PSAPI is the Process Status API
178 set(PLATFORM_LIBRARIES winmm ws2_32 psapi) 187 set(PLATFORM_LIBRARIES winmm ws2_32 psapi imm32 version)
179 188
180 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up) 189 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up)
181 add_definitions(-D_WIN32_WINNT=0x0600) 190 add_definitions(-D_WIN32_WINNT=0x0600)
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h
index 30613b3b0..f45c9ba82 100644
--- a/externals/microprofile/microprofile.h
+++ b/externals/microprofile/microprofile.h
@@ -512,7 +512,7 @@ typedef int MpSocket;
512 512
513#ifndef _WIN32 513#ifndef _WIN32
514typedef pthread_t MicroProfileThread; 514typedef pthread_t MicroProfileThread;
515#elif defined(_WIN32) 515#elif defined(_MSC_VER)
516typedef HANDLE MicroProfileThread; 516typedef HANDLE MicroProfileThread;
517#else 517#else
518typedef std::thread* MicroProfileThread; 518typedef std::thread* MicroProfileThread;
@@ -921,7 +921,7 @@ void MicroProfileThreadJoin(MicroProfileThread* pThread)
921 int r = pthread_join(*pThread, 0); 921 int r = pthread_join(*pThread, 0);
922 MP_ASSERT(r == 0); 922 MP_ASSERT(r == 0);
923} 923}
924#elif defined(_WIN32) 924#elif defined(_MSC_VER)
925typedef HANDLE MicroProfileThread; 925typedef HANDLE MicroProfileThread;
926DWORD _stdcall ThreadTrampoline(void* pFunc) 926DWORD _stdcall ThreadTrampoline(void* pFunc)
927{ 927{
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index b904fec16..99cc3f096 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -48,6 +48,10 @@
48#include "qhexedit.h" 48#include "qhexedit.h"
49#include "video_core/video_core.h" 49#include "video_core/video_core.h"
50 50
51#ifdef QT_STATICPLUGIN
52Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
53#endif
54
51GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { 55GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
52 Pica::g_debug_context = Pica::DebugContext::Construct(); 56 Pica::g_debug_context = Pica::DebugContext::Construct();
53 57
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 596ae01bf..df1008180 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -11,7 +11,8 @@
11#include "common/common_paths.h" 11#include "common/common_paths.h"
12#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/string_util.h" 13#include "common/string_util.h"
14#ifdef _MSC_VER 14
15#ifdef _WIN32
15#include <codecvt> 16#include <codecvt>
16#include <Windows.h> 17#include <Windows.h>
17#include "common/common_funcs.h" 18#include "common/common_funcs.h"
@@ -270,7 +271,7 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
270 return result; 271 return result;
271} 272}
272 273
273#ifdef _MSC_VER 274#ifdef _WIN32
274 275
275std::string UTF16ToUTF8(const std::u16string& input) { 276std::string UTF16ToUTF8(const std::u16string& input) {
276#if _MSC_VER >= 1900 277#if _MSC_VER >= 1900
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index ceb993ea1..aea43e92b 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -14,7 +14,7 @@
14#include <numeric> 14#include <numeric>
15#include <fcntl.h> 15#include <fcntl.h>
16 16
17#ifdef _MSC_VER 17#ifdef _WIN32
18#include <WinSock2.h> 18#include <WinSock2.h>
19#include <common/x64/abi.h> 19#include <common/x64/abi.h>
20#include <io.h> 20#include <io.h>