Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Linux-to-Windows cross compile via MinGW #203

Merged
merged 1 commit into from
Mar 16, 2016

Conversation

dneto0
Copy link
Contributor

@dneto0 dneto0 commented Mar 14, 2016

NOTE: MinGW can't compile googletest, so if #190 goes in first, then we must rework this pull request.

Supports Shaderc google/shaderc#169

@dneto0
Copy link
Contributor Author

dneto0 commented Mar 14, 2016

Looking for feedback and testing from @AWoloszyn

This PR should get the WIP label, but I can't apply it.

#include "../Include/Common.h"
#include "../Include/PoolAlloc.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without swapping these two, I get the following error:

FAILED: /usr/bin/i686-w64-mingw32-g++   -DGLSLANG_OSINCLUDE_WIN32 -std=c++11 -w -MMD -MT third_party/glslang/glslang/CMakeFiles/glslang.dir/MachineIndependent/PoolAlloc.cpp.obj -MF "third_party/glslang/glslang/CMakeFiles/glslang.dir/MachineIndependent/PoolAlloc.cpp.obj.d" -o third_party/glslang/glslang/CMakeFiles/glslang.dir/MachineIndependent/PoolAlloc.cpp.obj -c ../third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp
In file included from ../third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp:36:0:
../third_party/glslang/glslang/MachineIndependent/../Include/Common.h:42:22: error: previous declaration of ‘int sprintf_s(char*, size_t, const char*, ...)’ with ‘C++’ linkage
     #define snprintf sprintf_s
                      ^
In file included from /usr/share/mingw-w64/include/stdio.h:1000:0,
                 from /usr/share/mingw-w64/include/locale.h:12,
                 from /usr/include/c++/4.8/clocale:42,
                 from /usr/include/c++/4.8/i686-w64-mingw32/bits/c++locale.h:41,
                 from /usr/include/c++/4.8/bits/localefwd.h:40,
                 from /usr/include/c++/4.8/string:43,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/c++/4.8/array:38,
                 from /usr/include/c++/4.8/tuple:39,
                 from /usr/include/c++/4.8/unordered_set:41,
                 from ../third_party/glslang/glslang/MachineIndependent/../Include/Common.h:73,
                 from ../third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp:36:
/usr/share/mingw-w64/include/sec_api/stdio_s.h:29:78: error: conflicts with new declaration with ‘C’ linkage
   int __cdecl sprintf_s(char *_DstBuf,size_t _DstSize,const char *_Format,...);
                                                                              ^
In file included from /usr/include/c++/4.8/ext/string_conversions.h:43:0,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/stdexcept:39,
                 from /usr/include/c++/4.8/array:38,
                 from /usr/include/c++/4.8/tuple:39,
                 from /usr/include/c++/4.8/unordered_set:41,
                 from ../third_party/glslang/glslang/MachineIndependent/../Include/Common.h:73,
                 from ../third_party/glslang/glslang/MachineIndependent/PoolAlloc.cpp:36:
/usr/include/c++/4.8/cstdio:168:11: error: ‘::snprintf’ has not been declared
   using ::snprintf;
           ^
/usr/include/c++/4.8/cstdio:178:22: error: ‘__gnu_cxx::snprintf’ has not been declared
   using ::__gnu_cxx::snprintf;
                      ^

@AWoloszyn
Copy link
Contributor

I tested this compiling on Linux for Windows, and everything works correctly.

Change-Id: Ie52f0b1b2b20948c6f4b3cb5474537d36a5a3385
@dneto0
Copy link
Contributor Author

dneto0 commented Mar 16, 2016

Rebased against master, and @AWoloszyn retested on Windows.

No longer in DO NOT MERGE, no longer WIP.

@dneto0 dneto0 changed the title DO NOT MERGE: Support Linux-to-Windows cross compile via MinGW Support Linux-to-Windows cross compile via MinGW Mar 16, 2016
johnkslang added a commit that referenced this pull request Mar 16, 2016
Support Linux-to-Windows cross compile via MinGW
@johnkslang johnkslang merged commit b1dece2 into KhronosGroup:master Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants