Add optional CMake cross-build support for Clang/MinGW on Linux.#319
Add optional CMake cross-build support for Clang/MinGW on Linux.#319MrRealistic-Mods wants to merge 3 commits into
Conversation
Keeps existing MSVC/Premake workflow unchanged. Adds toolchain files and portable source fixes needed for Clang builds.
| using args_t = ArgPick<ArgTypes<>>; | ||
| META_END | ||
|
|
||
| META_BEGIN_OVERLOADED(CModelInfo::GetModelInfo, CBaseModelInfo*(char const*, int*)) |
There was a problem hiding this comment.
What was wrong with that?
There was a problem hiding this comment.
On clang\gcc, the second argument to META_BEGIN_OVERLOADED needs to be a function pointer type, that form was parsed as a function declaration, which MSVC accepts but Clang rejects.
| #ifdef _MSC_VER | ||
| uint8_t field_500[810]; | ||
| #else | ||
| uint8_t field_500[812]; // +2 to fill tail padding (Itanium ABI compatibility) |
There was a problem hiding this comment.
It could be simply 812 for all platforms?
There was a problem hiding this comment.
if msvc still passes VALIDATE_SIZE(CCam, 0x500) with 812, yes
I can't check that
There was a problem hiding this comment.
if msvc still passes VALIDATE_SIZE(CCam, 0x500) with 812, yes I can't check that
Yes, still reports 0x500. If you forked entire repo you should also have github actions, which include compilation for each configuration.
| class CCamScriptInstruction { | ||
| public: | ||
| uint8_t field_1; | ||
| #ifndef _MSC_VER |
There was a problem hiding this comment.
Can not pragma pack fix this? Or maybe there is global way to define packing size for gcc?
We generally try to get rid of pad variables, as these were not present in original sources at all.
There was a problem hiding this comment.
#pragma pack cannot fix this, and there is no global compiler flag to disable this behavior in GCC/Clang under the GNU/MinGW C++ ABI.
There was a problem hiding this comment.
Why added in root directory?
Similar utils are already placed in tools or tools\premake
|
Why this entire feature is not based on premake? It is matter of just adding another platform. Nobody want to duplicate and maintain two separate ways to generate projects. |
Added toolchain files and portable source fixes needed for Clang builds.