fix: correct compiler parsing

This commit is contained in:
Robert Schulze 2022-09-05 17:49:00 +00:00
parent 401747eaa7
commit 438ed368a1
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A

View File

@ -130,6 +130,7 @@ def parse_env_variables(
ARM_SUFFIX = "-aarch64"
FREEBSD_SUFFIX = "-freebsd"
PPC_SUFFIX = "-ppc64le"
AMD64_SSE2_SUFFIX = "-amd64sse2"
result = []
result.append("OUTPUT_DIR=/output")
@ -141,6 +142,7 @@ def parse_env_variables(
is_cross_arm = compiler.endswith(ARM_SUFFIX)
is_cross_ppc = compiler.endswith(PPC_SUFFIX)
is_cross_freebsd = compiler.endswith(FREEBSD_SUFFIX)
is_amd64_sse2 = compiler.endswidth(AMD64_SSE2_SUFFIX)
if is_cross_darwin:
cc = compiler[: -len(DARWIN_SUFFIX)]
@ -186,13 +188,13 @@ def parse_env_variables(
cmake_flags.append(
"-DCMAKE_TOOLCHAIN_FILE=/build/cmake/linux/toolchain-ppc64le.cmake"
)
elif is_amd64_sse2:
cc = compiler[: -len(AMD64_SSE2_SUFFIX)]
result.append("DEB_ARCH=amd64")
else:
cc = compiler
result.append("DEB_ARCH=amd64")
if compiler.endswith("-amd64sse2"):
cmake_flags.append('-DNO_SSE3_OR_HIGHER=1')
cxx = cc.replace("gcc", "g++").replace("clang", "clang++")
if package_type == "deb":