diff options
| author | Stefan Boberg <[email protected]> | 2026-03-16 10:52:45 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-16 10:52:45 +0100 |
| commit | 79e10a165cf09dc2cc120b3a226c51f87c235f20 (patch) | |
| tree | cf51b07e097904044b4bf65bc3fe0ad14134074f /repo | |
| parent | Linux build improvements (#843) (diff) | |
| download | zen-79e10a165cf09dc2cc120b3a226c51f87c235f20.tar.xz zen-79e10a165cf09dc2cc120b3a226c51f87c235f20.zip | |
Enable cross compilation of Windows targets on Linux (#839)
This PR makes it *possible* to do a Windows build on Linux via `clang-cl`.
It doesn't actually change any build process. No policy change, just mechanics and some code fixes to clear clang compilation.
The code fixes are mainly related to #include file name casing, to match the on-disk casing of the SDK files (via xwin).
Diffstat (limited to 'repo')
| -rw-r--r-- | repo/packages/c/consul/xmake.lua | 8 | ||||
| -rw-r--r-- | repo/packages/n/nomad/xmake.lua | 3 | ||||
| -rw-r--r-- | repo/packages/o/oidctoken/xmake.lua | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/repo/packages/c/consul/xmake.lua b/repo/packages/c/consul/xmake.lua index 6982e6f03..82bd803b6 100644 --- a/repo/packages/c/consul/xmake.lua +++ b/repo/packages/c/consul/xmake.lua @@ -29,10 +29,14 @@ package("consul") end) on_test(function (package) + -- Skip binary verification when cross-compiling (e.g. Windows target on Linux host) + if package:is_cross() then + return + end if is_plat("windows") then os.run("%s version", package:installdir("bin", "consul.exe")) - elseif is_plat("linux") then - -- this should include macosx as well, but needs more logic to differentiate arm64 vs + elseif is_plat("linux") then + -- this should include macosx as well, but needs more logic to differentiate arm64 vs -- amd64 since arm64 binary won't run on amd64 macs. arm64 macs have Rosetta though so -- they can run the amd64 binary. os.run("%s version", package:installdir("bin", "consul")) diff --git a/repo/packages/n/nomad/xmake.lua b/repo/packages/n/nomad/xmake.lua index 85ea10985..20380e1a1 100644 --- a/repo/packages/n/nomad/xmake.lua +++ b/repo/packages/n/nomad/xmake.lua @@ -29,6 +29,9 @@ package("nomad") end) on_test(function (package) + if package:is_cross() then + return + end if is_plat("windows") then os.run("%s version", package:installdir("bin", "nomad.exe")) elseif is_plat("linux") then diff --git a/repo/packages/o/oidctoken/xmake.lua b/repo/packages/o/oidctoken/xmake.lua index 76360e7bf..4dc231b21 100644 --- a/repo/packages/o/oidctoken/xmake.lua +++ b/repo/packages/o/oidctoken/xmake.lua @@ -15,6 +15,9 @@ package("oidctoken") end) on_test(function (package) + if package:is_cross() then + return + end if is_plat("windows") then os.run("%s --help", package:installdir("bin", "OidcToken.exe")) else |