-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use clang-cl as build machine compiler
- Loading branch information
Showing
6 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,22 +233,31 @@ jobs: | |
uses: ilammy/[email protected] | ||
- name: build | ||
run: | | ||
if ("${{matrix.arch}}" -eq 'ARM64') { | ||
$buildcc = "--native-file=.github/workflows/meson-vs-gcc.txt" | ||
$hostarch = "--cross-file=.github/workflows/meson-vs-aarch64.txt" | ||
$hostcc = "--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | ||
# clang-cl needs extra args to target a particular architecture. | ||
$hostcc_args = if (${{matrix.cc}} -eq 'clang-cl') { | ||
"--cross-file=.github/workflows/meson-vs-clang-cl-aarch64.txt" | ||
if ("${{matrix.arch}}" -eq 'x64') { # Native compilation. | ||
$hostcc = ` | ||
"--native-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | ||
} else { # Cross compilation. | ||
# The build machine compiler is always clang-cl, and it needs flags | ||
# to specify the build machine. | ||
$buildcc = "--native-file=.github/workflows/meson-vs-clang-cl.txt" | ||
$buildcc_args = "--native-file=meson-vs-clang-cl-amd64.txt" | ||
# The host compiler could be clang-cl or cl | ||
# clang-cl needs flags to target the host machine. | ||
# cl already targets the host machine. | ||
$hostcc = ` | ||
"--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | ||
if (${{matrix.cc}} -eq 'clang-cl') { | ||
$hostcc_args = ` | ||
"--cross-file=.github/workflows/meson-vs-clang-cl-${{matrix.arch}}.txt" | ||
$hostcc_arch = ` | ||
"--cross-file=.github/workflows/meson-vs-${{matrix.arch}}.txt" | ||
} | ||
} else { | ||
$hostcc = "--native-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | ||
} | ||
# Don't do debug builds because that triggers a Windows bug: | ||
# https://developercommunity.visualstudio.com/t/_setmaxstdio-hangs-the-program-if-the/10164855?space=62&q=setmaxstdio&viewtype=all | ||
meson setup build -Dbuildtype=release ` | ||
-Db_vscrt=static_from_buildtype ` | ||
$buildcc $hostarch $hostcc $hostcc_args | ||
$buildcc_args $buildcc $host_arch $hostcc_args $hostcc | ||
meson compile -C build | ||
- name: test | ||
run: meson test -C build | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[constants] | ||
clang_cl_target = 'aarch64-win32-msvc' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[constants] | ||
clang_cl_target = 'x86_64-pc-windows-msvc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters