From ed5fd5d8468b23ed6d0d12f09b14246e32feb68f Mon Sep 17 00:00:00 2001 From: David Neto Date: Sun, 28 Feb 2016 23:32:44 -0500 Subject: [PATCH] Support compilation via MinGW Change-Id: Ie52f0b1b2b20948c6f4b3cb5474537d36a5a3385 --- glslang/MachineIndependent/PoolAlloc.cpp | 2 +- glslang/MachineIndependent/intermOut.cpp | 2 +- glslang/OSDependent/Windows/CMakeLists.txt | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/glslang/MachineIndependent/PoolAlloc.cpp b/glslang/MachineIndependent/PoolAlloc.cpp index a41cadf1..d56979b4 100644 --- a/glslang/MachineIndependent/PoolAlloc.cpp +++ b/glslang/MachineIndependent/PoolAlloc.cpp @@ -32,8 +32,8 @@ //POSSIBILITY OF SUCH DAMAGE. // -#include "../Include/PoolAlloc.h" #include "../Include/Common.h" +#include "../Include/PoolAlloc.h" #include "../Include/InitializeGlobals.h" #include "../OSDependent/osinclude.h" diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index b52551ff..96b5c257 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -48,7 +48,7 @@ namespace { bool is_positive_infinity(double x) { #ifdef _MSC_VER return _fpclass(x) == _FPCLASS_PINF; -#elif defined __ANDROID__ || defined __linux__ +#elif defined __ANDROID__ || defined __linux__ || __MINGW32__ || __MINGW64__ return std::isinf(x) && (x >= 0); #else return isinf(x) && (x >= 0); diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt index ff0b99e9..9bc73a37 100644 --- a/glslang/OSDependent/Windows/CMakeLists.txt +++ b/glslang/OSDependent/Windows/CMakeLists.txt @@ -4,6 +4,12 @@ set(SOURCES ossource.cpp ../osinclude.h) add_library(OSDependent STATIC ${SOURCES}) +# MinGW GCC complains about function pointer casts to void*. +# Turn that off with -fpermissive. +if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") + target_compile_options(OSDependent PRIVATE -fpermissive) +endif() + if(WIN32) source_group("Source" FILES ${SOURCES}) endif(WIN32)