Skip to content

Commit 4803bee

Browse files
committed
Search arch specific lib directory
1 parent 6dea2bc commit 4803bee

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

lib/script.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def generate_products(self):
3535
variables += key + "=" + val
3636
variables += "\n"
3737
verbose_flags = """
38-
VERBOSE_FLAGS = """
38+
VERBOSE_FLAGS = """
3939
if Configuration.current.verbose:
4040
verbose_flags += "-v"
4141
verbose_flags += "\n"
@@ -80,7 +80,7 @@ def generate_products(self):
8080
BINUTILS_VERSION = 4.8
8181
TARGET_LDSYSROOT =
8282
"""
83-
83+
8484
if Configuration.current.bootstrap_directory is not None:
8585
base_flags += """
8686
BOOTSTRAP_DIR = """ + Configuration.current.bootstrap_directory.relative() + """/common
@@ -101,7 +101,7 @@ def generate_products(self):
101101
if Configuration.current.bootstrap_directory is not None:
102102
c_flags += """ -I${BOOTSTRAP_DIR}/usr/include -I${BOOTSTRAP_DIR}/usr/local/include """
103103
c_flags += """ -I${TARGET_BOOTSTRAP_DIR}/usr/include -I${TARGET_BOOTSTRAP_DIR}/usr/local/include """
104-
104+
105105
c_flags += Configuration.current.extra_c_flags
106106

107107
swift_flags = "\nTARGET_SWIFTCFLAGS = -I${SDKROOT}/lib/swift/" + Configuration.current.target.swift_sdk_name + " -Xcc -fblocks -resource-dir ${SDKROOT}/lib/swift "
@@ -120,9 +120,10 @@ def generate_products(self):
120120
swift_flags += "-O "
121121

122122
swift_flags += Configuration.current.extra_swift_flags
123-
123+
124124
swift_flags += """
125-
TARGET_SWIFTEXE_FLAGS = -I${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """
125+
TARGET_SWIFTEXE_FLAGS = -I${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + \
126+
""" -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """/""" +Configuration.current.target.swift_arch + """ """
126127
if Configuration.current.build_mode == Configuration.Debug:
127128
swift_flags += "-g -Onone -enable-testing "
128129
elif Configuration.current.build_mode == Configuration.Release:
@@ -135,7 +136,8 @@ def generate_products(self):
135136
EXTRA_LD_FLAGS = """ + Configuration.current.extra_ld_flags
136137

137138
ld_flags += """
138-
TARGET_LDFLAGS = --target=${TARGET} ${EXTRA_LD_FLAGS} -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """
139+
TARGET_LDFLAGS = --target=${TARGET} ${EXTRA_LD_FLAGS} -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + \
140+
""" -L${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """/""" +Configuration.current.target.swift_arch + """ """
139141
if Configuration.current.system_root is not None:
140142
ld_flags += "--sysroot=${SYSROOT}"
141143

@@ -174,11 +176,11 @@ def generate_products(self):
174176

175177
compilec_command = """
176178
rule CompileC
177-
command = mkdir -p `dirname $out`; ${CLANG} ${TARGET_CFLAGS} $flags ${VERBOSE_FLAGS} -c $in -o $out
179+
command = mkdir -p `dirname $out`; ${CLANG} ${TARGET_CFLAGS} $flags ${VERBOSE_FLAGS} -c $in -o $out
178180
description = CompileC: $in
179181
180182
rule CompileCxx
181-
command = mkdir -p `dirname $out`; ${CLANGXX} ${TARGET_CFLAGS} ${TARGET_CXXFLAGS} $flags ${VERBOSE_FLAGS} -c $in -o $out
183+
command = mkdir -p `dirname $out`; ${CLANGXX} ${TARGET_CFLAGS} ${TARGET_CXXFLAGS} $flags ${VERBOSE_FLAGS} -c $in -o $out
182184
description = CompileCxx: $in
183185
"""
184186

@@ -195,13 +197,13 @@ def generate_products(self):
195197

196198
assembler_command = """
197199
rule Assemble
198-
command = mkdir -p `dirname $out`; ${CLANG} -x assembler-with-cpp -c $in -o $out ${TARGET_CFLAGS} $flags ${VERBOSE_FLAGS}
200+
command = mkdir -p `dirname $out`; ${CLANG} -x assembler-with-cpp -c $in -o $out ${TARGET_CFLAGS} $flags ${VERBOSE_FLAGS}
199201
description = Assemble: $in
200202
"""
201203

202204
link_command = """
203205
rule Link
204-
command = mkdir -p `dirname $out`; ${CLANG} ${TARGET_LDFLAGS} ${VERBOSE_FLAGS} $start $in $end $flags -o $out"""
206+
command = mkdir -p `dirname $out`; ${CLANG} ${TARGET_LDFLAGS} ${VERBOSE_FLAGS} $start $in $end $flags -o $out"""
205207
if Configuration.current.verbose:
206208
link_command += "-Xlinker --verbose"
207209
link_command += """
@@ -211,7 +213,7 @@ def generate_products(self):
211213
command = mkdir -p `dirname $out`; ${AR} ${AR_FLAGS} $out $in
212214
description = Archive: $out
213215
"""
214-
216+
215217
swift_build_command = """
216218
rule SwiftExecutable
217219
command = mkdir -p `dirname $out`; ${SWIFTC} ${TARGET_SWIFTEXE_FLAGS} ${EXTRA_LD_FLAGS} $flags $in -o $out
@@ -267,5 +269,5 @@ def generate(self):
267269
for workspace in self.workspaces:
268270
workspace.configure()
269271
script = self.generate_workspaces()
270-
271-
272+
273+

0 commit comments

Comments
 (0)