Skip to content
Merged
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
3 changes: 1 addition & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

if Configuration.current.target.sdk == OSType.Linux:
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE '
foundation.LDFLAGS = '-Wl,@./CoreFoundation/linux.ld -Xlinker -T ${SDKROOT}/lib/swift/linux/${ARCH}/swift.ld -lswiftGlibc `icu-config --ldflags` -Wl,-defsym,__CFConstantStringClassReference=_TMC10Foundation19_NSCFConstantString -Wl,-Bsymbolic '

foundation.LDFLAGS = '${SWIFT_USE_LINKER} -Wl,@./CoreFoundation/linux.ld -lswiftGlibc `icu-config --ldflags` -Wl,-defsym,__CFConstantStringClassReference=_TMC10Foundation19_NSCFConstantString -Wl,-Bsymbolic '
elif Configuration.current.target.sdk == OSType.FreeBSD:
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_FREEBSD -I/usr/local/include -I/usr/local/include/libxml2 '
foundation.LDFLAGS = ''
Expand Down
8 changes: 6 additions & 2 deletions lib/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def project_headers_path(self):
return Path.path(Configuration.current.build_directory.path_by_appending(self.name).absolute() + "/" + self.PROJECT_HEADERS_FOLDER_PATH)

class Library(Product):
conformance_begin = ""
conformance_end = ""
rule = None
def __init__(self, name):
Product.__init__(self, name)
Expand All @@ -88,7 +90,7 @@ def generate(self, flags):
product_flags += " -lstdc++"

generated += """
build """ + self.product.relative() + """: """ + self.rule + """ """ + " ".join(objects) + self.generate_dependencies() + """
build """ + self.product.relative() + """: """ + self.rule + """ """ + self.conformance_begin + """ """ + " ".join(objects) + """ """ + self.conformance_end + """ """ + self.generate_dependencies() + """
flags = """ + product_flags
if self.needs_objc:
generated += """
Expand All @@ -114,7 +116,9 @@ def __init__(self, name):
self.product_name = Configuration.current.target.dynamic_library_prefix + name + Configuration.current.target.dynamic_library_suffix

def generate(self):
if Configuration.current.target.sdk == OSType.Linux:
if Configuration.current.target.sdk == OSType.Linux or Configuration.current.target.sdk == OSType.FreeBSD:
self.conformance_begin = '${SDKROOT}/lib/swift/linux/${ARCH}/swift_begin.o'
self.conformance_end = '${SDKROOT}/lib/swift/linux/${ARCH}/swift_end.o'
return Library.generate(self, ["-shared", "-Wl,-soname," + self.product_name, "-Wl,--no-undefined"])
else:
return Library.generate(self, ["-shared"])
Expand Down