Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scons with_x86_64h option on macOS #1642

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tools/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

import common_compiler_flags
from SCons.Variables import BoolVariable


def has_osxcross():
Expand All @@ -11,6 +12,7 @@ def has_osxcross():
def options(opts):
opts.Add("macos_deployment_target", "macOS deployment target", "default")
opts.Add("macos_sdk_path", "macOS SDK path", "")
opts.Add(BoolVariable("with_x86_64h", "If arch=x86_64 or universal, include an x86_64h slice.", False))
if has_osxcross():
opts.Add("osxcross_sdk", "OSXCross SDK version", "darwin16")

Expand Down Expand Up @@ -55,6 +57,10 @@ def generate(env):
env.Append(LINKFLAGS=["-arch", env["arch"]])
env.Append(CCFLAGS=["-arch", env["arch"]])

if env["with_x86_64h"] and env["arch"] in ["universal", "x86_64"]:
env.Append(LINKFLAGS=["-arch", "x86_64h"])
env.Append(CCFLAGS=["-arch", "x86_64h"])

if env["macos_deployment_target"] != "default":
env.Append(CCFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
env.Append(LINKFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
Expand Down
Loading