Files
ports/lib/arch.py
T
2026-10-08 14:45:25 +00:00

42 lines
1.2 KiB
Python

import os
from . import packie
all: dict[str, dict[str, str]] = {
"aarch64-semios-linux": {
"CC": "clang -target aarch64-unknown-linux-musl",
"CXX": "clang++ -target aarch64-unknown-linux-musl",
"CFLAGS": "-O3 -flto=thin",
"CXXFLAGS": "-O3 -flto=thin",
"LDFLAGS": "-flto=thin",
},
"x86_64-semios-linux": {
"CC": "clang -target x86_64-unknown-linux-musl",
"CXX": "clang++ -target x86_64-unknown-linux-musl",
"CFLAGS": "-O3 -march=x86-64-v3 -flto=thin",
"CXXFLAGS": "-O3 -march=x86-64-v3 -flto=thin",
"LDFLAGS": "-flto=thin",
"RUSTFLAGS": "-Ctarget-cpu=x86_64-v3",
},
"riscv64-semios-linux": {
"CC": "clang -target riscv64-unknown-linux-musl",
"CXX": "clang++ -target riscv64-unknown-linux-musl",
"CFLAGS": "-O3 -flto=thin",
"CXXFLAGS": "-O3 -flto=thin",
"LDFLAGS": "-flto=thin",
},
}
_target: str = packie.host_arch()
def get_target():
return _target
def set_target(arch: str):
global _target
_target = arch
for key in all[_target].keys():
if not os.environ.get(key):
os.environ[key] = all[_target][key]