Skip to content

Add optional CMake cross-build support for Clang/MinGW on Linux.#319

Open
MrRealistic-Mods wants to merge 3 commits into
DK22Pac:masterfrom
MrRealistic-Mods:feature/clang-cmake-linux
Open

Add optional CMake cross-build support for Clang/MinGW on Linux.#319
MrRealistic-Mods wants to merge 3 commits into
DK22Pac:masterfrom
MrRealistic-Mods:feature/clang-cmake-linux

Conversation

@MrRealistic-Mods

Copy link
Copy Markdown

Added toolchain files and portable source fixes needed for Clang builds.

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*))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What was wrong with that?

@MrRealistic-Mods MrRealistic-Mods Jun 21, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Comment thread plugin_IV/game_IV/CCam.h Outdated
#ifdef _MSC_VER
uint8_t field_500[810];
#else
uint8_t field_500[812]; // +2 to fill tail padding (Itanium ABI compatibility)

@MiranDMC MiranDMC Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It could be simply 812 for all platforms?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

if msvc still passes VALIDATE_SIZE(CCam, 0x500) with 812, yes
I can't check that

@MiranDMC MiranDMC Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@MiranDMC MiranDMC Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

#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.

Comment thread CMakeLists.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why added in root directory?
Similar utils are already placed in tools or tools\premake

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I changed to premake

@MiranDMC

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants