Skip to content

Search arch specific lib directory #1354

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
23 changes: 18 additions & 5 deletions lib/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,18 @@ def generate_products(self):
swift_flags += "-O "

swift_flags += Configuration.current.extra_swift_flags

swift_flags += """
TARGET_SWIFTEXE_FLAGS = -I${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """
TARGET_SWIFTEXE_FLAGS = """
if Configuration.current.target.fat_binaries:
swift_flags += """ -I${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name
swift_flags += """ -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name
else:
swift_flags += """ -I${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """/""" + Configuration.current.target.swift_arch
swift_flags += """ -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """/""" + Configuration.current.target.swift_arch

if Configuration.current.build_mode == Configuration.Debug:
swift_flags += "-g -Onone -enable-testing "
swift_flags += " -g -Onone -enable-testing "
elif Configuration.current.build_mode == Configuration.Release:
swift_flags += " "
swift_flags += Configuration.current.extra_swift_flags
Expand All @@ -135,9 +142,15 @@ def generate_products(self):
EXTRA_LD_FLAGS = """ + Configuration.current.extra_ld_flags

ld_flags += """
TARGET_LDFLAGS = --target=${TARGET} ${EXTRA_LD_FLAGS} -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """
TARGET_LDFLAGS = --target=${TARGET} ${EXTRA_LD_FLAGS} """

if Configuration.current.target.fat_binaries:
ld_flags += """-L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name
else:
ld_flags += """-L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """/""" + Configuration.current.target.swift_arch

if Configuration.current.system_root is not None:
ld_flags += "--sysroot=${SYSROOT}"
ld_flags += " --sysroot=${SYSROOT}"

if Configuration.current.bootstrap_directory is not None:
ld_flags += """ -L${TARGET_BOOTSTRAP_DIR}/usr/lib"""
Expand Down
2 changes: 2 additions & 0 deletions lib/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ class Target:
dynamic_library_suffix = ".dylib"
static_library_prefix = "lib"
static_library_suffix = ".a"
fat_binaries = False

def __init__(self, triple):
if "linux" in triple:
Expand All @@ -349,6 +350,7 @@ def __init__(self, triple):
self.environ = EnvironmentType.UnknownEnvironment
elif "darwin" in triple:
self.sdk = OSType.MacOSX
self.fat_binaries = True
else:
print("Unknown platform")

Expand Down