mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 10:27:16 +02:00
fix clang on macos-14 (arm64)
This commit is contained in:
22
.github/generate-job-matrix.py
vendored
22
.github/generate-job-matrix.py
vendored
@ -26,14 +26,11 @@ def make_gcc_config(version: int) -> Configuration:
|
|||||||
def make_clang_config(
|
def make_clang_config(
|
||||||
version: int, platform: typing.Literal["x86-64", "arm64"] = "x86-64"
|
version: int, platform: typing.Literal["x86-64", "arm64"] = "x86-64"
|
||||||
) -> Configuration:
|
) -> Configuration:
|
||||||
ret = SimpleNamespace(
|
cfg = SimpleNamespace(
|
||||||
name=f"Clang-{version} ({platform})",
|
name=f"Clang-{version} ({platform})",
|
||||||
os=None, # replaced below
|
|
||||||
compiler=SimpleNamespace(
|
compiler=SimpleNamespace(
|
||||||
type="CLANG",
|
type="CLANG",
|
||||||
version=version,
|
version=version,
|
||||||
cc=f"clang-{version}",
|
|
||||||
cxx=f"clang++-{version}",
|
|
||||||
),
|
),
|
||||||
lib="libc++",
|
lib="libc++",
|
||||||
cxx_modules=version >= 17,
|
cxx_modules=version >= 17,
|
||||||
@ -41,15 +38,18 @@ def make_clang_config(
|
|||||||
)
|
)
|
||||||
match platform:
|
match platform:
|
||||||
case "x86-64":
|
case "x86-64":
|
||||||
ret.os = "ubuntu-22.04" if version < 17 else "ubuntu-24.04"
|
cfg.os = "ubuntu-22.04" if version < 17 else "ubuntu-24.04"
|
||||||
|
cfg.compiler.cc = f"clang-{version}"
|
||||||
|
cfg.compiler.cxx = f"clang++-{version}"
|
||||||
case "arm64":
|
case "arm64":
|
||||||
ret.os = "macos-14"
|
cfg.os = "macos-14"
|
||||||
pfx = f"/opt/homebrew/opt/llvm@{version}/bin/"
|
pfx = f"/opt/homebrew/opt/llvm@{version}/bin"
|
||||||
ret.compiler.cc = pfx + ret.compiler.cc
|
cfg.compiler.cc = f"{pfx}/clang"
|
||||||
ret.compiler.cxx = pfx + ret.compiler.cxx
|
cfg.compiler.cxx = f"{pfx}/clang++"
|
||||||
case _:
|
case _:
|
||||||
raise KeyError(f"Unsupported platform {platform!r} for Clang")
|
raise KeyError(f"Unsupported platform {platform!r} for Clang")
|
||||||
ret.compiler = Compiler(**vars(ret.compiler))
|
ret = cfg
|
||||||
|
ret.compiler = Compiler(**vars(cfg.compiler))
|
||||||
return Configuration(**vars(ret))
|
return Configuration(**vars(ret))
|
||||||
|
|
||||||
|
|
||||||
@ -92,6 +92,8 @@ configs = {
|
|||||||
make_clang_config(ver, platform)
|
make_clang_config(ver, platform)
|
||||||
for ver in [16, 17, 18]
|
for ver in [16, 17, 18]
|
||||||
for platform in ["x86-64", "arm64"]
|
for platform in ["x86-64", "arm64"]
|
||||||
|
# arm64 runners are expensive; only consider one version
|
||||||
|
if ver == 18 or platform != "arm64"
|
||||||
]
|
]
|
||||||
+ [make_apple_clang_config(ver) for ver in [15]]
|
+ [make_apple_clang_config(ver) for ver in [15]]
|
||||||
+ [make_msvc_config(release="14.4", version=194)]
|
+ [make_msvc_config(release="14.4", version=194)]
|
||||||
|
Reference in New Issue
Block a user