-
Notifications
You must be signed in to change notification settings - Fork 853
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
Conversation
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" |
There was a problem hiding this comment.
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;
^
I tested this compiling on Linux for Windows, and everything works correctly. |
Change-Id: Ie52f0b1b2b20948c6f4b3cb5474537d36a5a3385
Rebased against master, and @AWoloszyn retested on Windows. No longer in DO NOT MERGE, no longer WIP. |
Support Linux-to-Windows cross compile via MinGW
NOTE: MinGW can't compile googletest, so if #190 goes in first, then we must rework this pull request.
Supports Shaderc google/shaderc#169