diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-14 07:28:05 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-14 07:28:05 +0000 |
| commit | e1d6dc27ec013dfecde942c7690432925ce3e23a (patch) | |
| tree | a21f16fb6959c0f46394057ae65cee470674e916 /unityplugin/GhostCubePlugin/PluginSource | |
| parent | Merge pull request #25 from kkulling/patch-1 (diff) | |
| download | DiligentEngine-e1d6dc27ec013dfecde942c7690432925ce3e23a.tar.gz DiligentEngine-e1d6dc27ec013dfecde942c7690432925ce3e23a.zip | |
Fixed MinGW build
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
3 files changed, 19 insertions, 14 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt index d7388ad..8737991 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt +++ b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt @@ -51,7 +51,7 @@ else() ) endif() -if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS) +if(MSVC) target_sources(GhostCubePlugin-shared PRIVATE src/RenderingPlugin.def @@ -82,19 +82,20 @@ endif() set_common_target_properties(GhostCubePlugin-shared) +if(PLATFORM_WIN32) + target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_WIN=1) +elseif(PLATFORM_UNIVERSAL_WINDOWS) + target_compile_definitions(GhostCubePlugin-shared PRIVATE WINDOWS_UWP=1 UNITY_METRO=1) +elseif(PLATFORM_ANDROID) + target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_ANDROID=1) +elseif(PLATFORM_LINUX) + target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_LINUX=1) +endif() + if(MSVC) # Disable MSVC-specific warnings # - w4201: nonstandard extension used: nameless struct/unio target_compile_options(GhostCubePlugin-shared PRIVATE /wd4201) - if(PLATFORM_UNIVERSAL_WINDOWS) - target_compile_definitions(GhostCubePlugin-shared PRIVATE WINDOWS_UWP UNITY_METRO) - endif() -endif() - -if(PLATFORM_ANDROID) - target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_ANDROID) -elseif(PLATFORM_LINUX) - target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_LINUX) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h b/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h index fc407b0..bc4c6e0 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h +++ b/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h @@ -13,16 +13,16 @@ // UNITY_ANDROID - Android // UNITY_METRO - WSA or UWP // UNITY_WEBGL - WebGL -#if _MSC_VER - #define UNITY_WIN 1 +#if defined(UNITY_WIN) || defined(UNITY_METRO) || defined(UNITY_ANDROID) || defined(UNITY_LINUX) || defined(UNITY_WEBGL) + // these are defined externally +#elif _MSC_VER + #define UNITY_WIN 1 #elif defined(__APPLE__) #if defined(__arm__) || defined(__arm64__) #define UNITY_IPHONE 1 #else #define UNITY_OSX 1 #endif -#elif defined(UNITY_METRO) || defined(UNITY_ANDROID) || defined(UNITY_LINUX) || defined(UNITY_WEBGL) - // these are defined externally #elif defined(__EMSCRIPTEN__) // this is already defined in Unity 5.6 #define UNITY_WEBGL 1 diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp index 7b71f16..7ff8fc7 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp @@ -5,6 +5,10 @@ #include "RenderAPI.h" #include "SamplePlugin.h" +#if PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS + #include <crtdbg.h> +#endif + #include <vector> using namespace Diligent; |
