2
0
Эх сурвалжийг харах

Merge pull request #14595 from hpvb/fix-mingw-build

Fix mingw build for thekla_atlas
Rémi Verschelde 7 жил өмнө
parent
commit
fb12d700c9

+ 7 - 3
modules/thekla_unwrap/SCsub

@@ -59,11 +59,15 @@ if env['builtin_thekla_atlas']:
     env_thekla_unwrap.Append(CXXFLAGS="-std=gnu++11")
     env_thekla_unwrap.Append(CXXFLAGS="-std=gnu++11")
 
 
     if env["platform"] == 'x11':
     if env["platform"] == 'x11':
-        env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX"])
+        env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
     elif env["platform"] == 'osx':
     elif env["platform"] == 'osx':
-        env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN"])
+        env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
     elif env["platform"] == 'windows':
     elif env["platform"] == 'windows':
-        env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32"])
+        if env.msvc:
+            env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
+        else:
+            env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC"])
+            env.Append(LIBS=["dbghelp"])
         
         
 # Godot source files
 # Godot source files
 env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp")
 env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp")

+ 8 - 10
thirdparty/thekla_atlas/nvcore/Debug.cpp

@@ -14,17 +14,15 @@
 #   define VC_EXTRALEAN
 #   define VC_EXTRALEAN
 #   include <windows.h>
 #   include <windows.h>
 #   include <direct.h>
 #   include <direct.h>
-#   if NV_CC_MSVC
-#       include <crtdbg.h>
-#       if _MSC_VER < 1300
-#           define DECLSPEC_DEPRECATED
+#   include <crtdbg.h>
+#   if _MSC_VER < 1300
+#       define DECLSPEC_DEPRECATED
 // VC6: change this path to your Platform SDK headers
 // VC6: change this path to your Platform SDK headers
-#           include <dbghelp.h> // must be XP version of file
-//          include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h"
-#       else
+#       include <dbghelp.h> // must be XP version of file
+//      include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h"
+#   else
 // VC7: ships with updated headers
 // VC7: ships with updated headers
-#           include <dbghelp.h>
-#       endif
+#       include <dbghelp.h>
 #   endif
 #   endif
 #   pragma comment(lib,"dbghelp.lib")
 #   pragma comment(lib,"dbghelp.lib")
 #endif
 #endif
@@ -110,7 +108,7 @@ namespace
 #endif
 #endif
 
 
 
 
-#if (NV_OS_WIN32 && NV_CC_MSVC) || NV_OS_DURANGO
+#if NV_OS_WIN32 || NV_OS_DURANGO
 
 
     // We should try to simplify the top level filter as much as possible.
     // We should try to simplify the top level filter as much as possible.
     // http://www.nynaeve.net/?p=128
     // http://www.nynaeve.net/?p=128

+ 1 - 1
thirdparty/thekla_atlas/nvcore/DefsGnucWin32.h

@@ -19,7 +19,7 @@
 #endif
 #endif
 
 
 #define NV_FASTCALL		__attribute__((fastcall))
 #define NV_FASTCALL		__attribute__((fastcall))
-#define NV_FORCEINLINE	__attribute__((always_inline))
+#define NV_FORCEINLINE	__attribute__((always_inline)) inline
 #define NV_DEPRECATED   __attribute__((deprecated))
 #define NV_DEPRECATED   __attribute__((deprecated))
 
 
 #if __GNUC__ > 2
 #if __GNUC__ > 2