Skip to content

Tooling/Add experimental clang-cl cross-build - #80

Merged
ZivDero merged 12 commits into
OpenTS-Developers:mainfrom
Belonit:tooling/clang-cl-cross-build
Sep 1, 2026
Merged

Tooling/Add experimental clang-cl cross-build#80
ZivDero merged 12 commits into
OpenTS-Developers:mainfrom
Belonit:tooling/clang-cl-cross-build

Conversation

@Belonit

@Belonit Belonit commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an experimental Linux-hosted Win32 cross-build using clang-cl with the MSVC
ABI, headers, and libraries. The branch also makes the C++ sources and legacy
assembly accepted by clang-cl, aligns bgfx render-record allocations, and adds a
VS Code IntelliSense example.

Behavior and compatibility

  • Supported Visual Studio 2022 Win32 Debug and Release behavior is preserved.
  • The clang-cl configuration is unsupported and does not expand the build matrix.
  • Therenderer translation unit now defines BX_CONFIG_DEBUG to match the bgfx libraries and allocates bgfx records alignment-correctly, keeping MSVC and clang-cl builds consistent.

The codebase may still contain undefined behavior the supported MSVC build does not expose, so a successful clang-cl build is not runtime evidence.
Validate any clang-cl result separately.

Known clang-cl runtime observations:

Validation

  • clang-cl 22.1.8, MSVC 14.44.35207, Windows SDK 10.0.26100.0: configured and
    built (Release, Ninja) with inherited warnings and no errors; LogStress passed, including 100,000 intact log lines.
  • Supported MSVC Win32 Release: build completed under Wine with cl 14.44.35207 (Ninja), including the test executables. The Visual Studio Debug configuration and CI were not exercised.

Documentation

docs/BUILDING.md documents the experimental toolchain requirements,
configuration, and the runtime limitation.

Checklist

  • The change is focused; unrelated mechanical cleanup is separate
  • Compatibility effects and any migration are explicit
  • Documentation impact is stated
  • Validation distinguishes what passed, failed, and was not run
  • No prohibited assets, binaries, SDKs, credentials, or generated output are included

@Belonit Belonit changed the title Tooling/clang cl cross build Tooling/clang-cl cross build Aug 30, 2026
@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch 3 times, most recently from 47a9078 to d910706 Compare August 30, 2026 23:12
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Development builds of e1391a5:

The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build.

@Belonit Belonit changed the title Tooling/clang-cl cross build Tooling/Add experimental clang-cl cross-build Aug 31, 2026
Comment thread code/tag.h Outdated
Comment thread docs/BUILDING.md Outdated
Comment thread code/CMakeLists.txt Outdated
@tomsons26

Copy link
Copy Markdown
Contributor

Old cdecl, register keyword and asm issues could be handled in another PR so that get's merged in faster.
Never meant to leave cdecl and register but forgot about them.

@ZivDero

ZivDero commented Aug 31, 2026

Copy link
Copy Markdown
Member

Okay should be smaller now

@ZivDero

ZivDero commented Aug 31, 2026

Copy link
Copy Markdown
Member

BX_CONFIG_DEBUG + allocator could also be their own PR. Arguably even a fix in general.

@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch from d949e58 to 7de1557 Compare August 31, 2026 16:09
@Belonit
Belonit marked this pull request as draft August 31, 2026 16:39
@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch from 7de1557 to 7c300ef Compare August 31, 2026 17:18
@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch from 7c300ef to dce5854 Compare August 31, 2026 17:33
@Belonit
Belonit marked this pull request as ready for review August 31, 2026 17:33
@Belonit

Belonit commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Updated.
General source and bgfx fixes are now merged separately, so this PR only contains the clang-cl tooling and VS Code configuration.

@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch from dce5854 to 36f6838 Compare August 31, 2026 18:16
@Belonit
Belonit requested a review from ZivDero August 31, 2026 18:58
@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch from a974cb5 to fea288a Compare September 1, 2026 09:47
@ZivDero ZivDero added the no change record Engine change needs no manual change record label Sep 1, 2026
@ZivDero
ZivDero merged commit 5deb935 into OpenTS-Developers:main Sep 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no change record Engine change needs no manual change record

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants