Skip to content

add support for linux clang cross compiles#1403

Open
ryleu wants to merge 3 commits intosmartcmd:mainfrom
ryleu:linux-clang-support
Open

add support for linux clang cross compiles#1403
ryleu wants to merge 3 commits intosmartcmd:mainfrom
ryleu:linux-clang-support

Conversation

@ryleu
Copy link
Copy Markdown

@ryleu ryleu commented Mar 24, 2026

Description

add support for compiling the exe from linux using clang

Changes

Previous Behavior

builds on linux with clang would fail in a number of ways

Root Cause

mostly due to weird capitalization issues and the use of backslashes in file paths

New Behavior

file paths now use forward slashes and proper capitalization, which shouldn't affect how it builds with msvc

Fix Implementation

i used a lot of sed find and replace. i also added a nix flake for building on nixos, which can serve as a sort of build instructions for people on linux too.

AI Use Disclosure

just for debugging help, not for any actual code writing. i never copy-pasted any ai code into my editor

Related Issues

@ryleu
Copy link
Copy Markdown
Author

ryleu commented Mar 24, 2026

sorry for the giant diff, but it had to be done at some point

@StevenSYS
Copy link
Copy Markdown

StevenSYS commented Mar 24, 2026

Doesn't #465 do the same thing as this PR?

@PUFFMON
Copy link
Copy Markdown

PUFFMON commented Mar 24, 2026

Could you modify COMPILE.md to add some instructions on how to compile it with clang?

@Jazzitch
Copy link
Copy Markdown
Contributor

@StevenSYS yes but it's really old.

@ryleu
Copy link
Copy Markdown
Author

ryleu commented Mar 26, 2026

Could you modify COMPILE.md to add some instructions on how to compile it with clang?

yeah i can this weekend. all the steps are in flake.nix if you wanna test it right now tho

@neoapps-dev
Copy link
Copy Markdown

Could you modify COMPILE.md to add some instructions on how to compile it with clang?

yeah i can this weekend. all the steps are in flake.nix if you wanna test it right now tho

it works quite well actually, and has been merged into LegacyEvolved

@ryleu ryleu force-pushed the linux-clang-support branch from 59dc208 to 7f6ed5f Compare March 30, 2026 20:56
# Conflicts:
#	Minecraft.Client/Common/UI/UIScene_ConnectingProgress.cpp
@ryleu
Copy link
Copy Markdown
Author

ryleu commented Mar 30, 2026

i modified COMPILE.md

@aaronfranke
Copy link
Copy Markdown

Someone should make a dedicated PR that just fixes the slashes in the include paths, which can be merged in advance, and then that will make PRs like this smaller and easier to review once rebased on top.

@ryleu
Copy link
Copy Markdown
Author

ryleu commented Apr 1, 2026

Someone should make...

be the change you want to see in the world

@sylvessa
Copy link
Copy Markdown
Collaborator

sylvessa commented Apr 1, 2026

@codeHusky thoughts on this?

@codeHusky
Copy link
Copy Markdown
Collaborator

running a build to see if it works

@sylvessa
Copy link
Copy Markdown
Collaborator

sylvessa commented Apr 2, 2026

me when the checks fail cause format check action is very dumb

ill also check if this works on my arch setup soon today, if it works there then i think it should be good for merging

@ryleu
Copy link
Copy Markdown
Author

ryleu commented Apr 2, 2026

as far as i can tell, running clang-format changes most of the files (when it doesn't eat all of my ram trying to format the one 96 thousand line file). it also changes most files on the repo before my pr tho, so idk if you want me to commit the formatting

@sylvessa
Copy link
Copy Markdown
Collaborator

sylvessa commented Apr 2, 2026

as far as i can tell, running clang-format changes most of the files (when it doesn't eat all of my ram trying to format the one 96 thousand line file). it also changes most files on the repo before my pr tho, so idk if you want me to commit the formatting

we removed the clang format action check anyways

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.

8 participants