mirror of
https://github.com/Z3Prover/z3
synced 2026-07-01 12:58:54 +00:00
Address code review: improve arch flag handling
- Extract target_arch_flag to variable to reduce duplication - Add .strip() calls to handle trailing spaces in environment variables - Ensure proper spacing in concatenated flags Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
728f773592
commit
c8ec7bc757
1 changed files with 4 additions and 3 deletions
|
|
@ -155,10 +155,11 @@ def mk_build_dir(path):
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
# On macOS, we can cross-compile using -arch flag
|
# On macOS, we can cross-compile using -arch flag
|
||||||
|
target_arch_flag = ' -arch x86_64'
|
||||||
myvar = {
|
myvar = {
|
||||||
"CXXFLAGS": os.environ.get("CXXFLAGS", "") + " -arch x86_64",
|
"CXXFLAGS": (os.environ.get("CXXFLAGS", "").strip() + target_arch_flag).strip(),
|
||||||
"CFLAGS": os.environ.get("CFLAGS", "") + " -arch x86_64",
|
"CFLAGS": (os.environ.get("CFLAGS", "").strip() + target_arch_flag).strip(),
|
||||||
"LDFLAGS": os.environ.get("LDFLAGS", "") + " -arch x86_64"
|
"LDFLAGS": (os.environ.get("LDFLAGS", "").strip() + target_arch_flag).strip()
|
||||||
}
|
}
|
||||||
env.update(myvar)
|
env.update(myvar)
|
||||||
if subprocess.call(opts, env=env) != 0:
|
if subprocess.call(opts, env=env) != 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue