|
9 | 9 |
|
10 | 10 | script = Script()
|
11 | 11 |
|
12 |
| -foundation = DynamicLibrary("Foundation") |
| 12 | +foundation = DynamicLibrary(Configuration.current.module_name) |
13 | 13 |
|
14 | 14 | foundation.GCC_PREFIX_HEADER = 'CoreFoundation/Base.subproj/CoreFoundation_Prefix.h'
|
15 | 15 |
|
|
22 | 22 | elif Configuration.current.target.sdk == OSType.MacOSX:
|
23 | 23 | foundation.CFLAGS = '-DDEPLOYMENT_TARGET_MACOSX '
|
24 | 24 | foundation.LDFLAGS = '-licucore -twolevel_namespace -Wl,-alias_list,CoreFoundation/Base.subproj/DarwinSymbolAliases -sectcreate __UNICODE __csbitmaps CoreFoundation/CharacterSets/CFCharacterSetBitmaps.bitmap -sectcreate __UNICODE __properties CoreFoundation/CharacterSets/CFUniCharPropertyDatabase.data -sectcreate __UNICODE __data CoreFoundation/CharacterSets/CFUnicodeData-L.mapping -segprot __UNICODE r r '
|
| 25 | + foundation.LDFLAGS += '-mmacosx-version-min=10.11 ' # Required to link symbol ___udivti3 from CFBigNumber |
| 26 | + foundation.LDFLAGS += '-init ___CFInitialize -install_name @rpath/lib' + foundation.name + '.dylib -Xlinker -no_deduplicate ' |
25 | 27 |
|
26 | 28 | if Configuration.current.build_mode == Configuration.Debug:
|
27 | 29 | foundation.LDFLAGS += ' -lswiftSwiftOnoneSupport '
|
|
48 | 50 | '-Wno-unused-variable',
|
49 | 51 | '-Wno-int-conversion',
|
50 | 52 | '-Wno-unused-function',
|
51 |
| - '-I/usr/include/libxml2', |
| 53 | + '-I${SYSROOT}/usr/include/libxml2', |
52 | 54 | '-I./',
|
53 | 55 | ])
|
54 | 56 |
|
55 | 57 | swift_cflags = [
|
56 |
| - '-I${BUILD_DIR}/Foundation/usr/lib/swift', |
57 |
| - '-I/usr/include/libxml2' |
| 58 | + '-I${BUILD_DIR}/${MODULE_NAME}/usr/lib/swift', |
| 59 | + '-I${SYSROOT}/usr/include/libxml2' |
58 | 60 | ]
|
59 | 61 |
|
60 | 62 | if "XCTEST_BUILD_DIR" in Configuration.current.variables:
|
61 | 63 | swift_cflags += [
|
62 | 64 | '-I${XCTEST_BUILD_DIR}',
|
63 | 65 | '-L${XCTEST_BUILD_DIR}',
|
64 |
| - '-I/usr/include/libxml2' |
| 66 | + '-I${SYSROOT}/usr/include/libxml2' |
65 | 67 | ]
|
66 | 68 |
|
67 | 69 | # Configure use of Dispatch in CoreFoundation and Foundation if libdispatch is being built
|
|
414 | 416 | extra_script = """
|
415 | 417 | rule InstallFoundation
|
416 | 418 | command = mkdir -p "${DSTROOT}/${PREFIX}/lib/swift/${OS}"; $
|
417 |
| - cp "${BUILD_DIR}/Foundation/${DYLIB_PREFIX}Foundation${DYLIB_SUFFIX}" "${DSTROOT}/${PREFIX}/lib/swift/${OS}"; $ |
| 419 | + cp "${BUILD_DIR}/${MODULE_NAME}/${DYLIB_PREFIX}${MODULE_NAME}${DYLIB_SUFFIX}" "${DSTROOT}/${PREFIX}/lib/swift/${OS}"; $ |
418 | 420 | mkdir -p "${DSTROOT}/${PREFIX}/lib/swift/${OS}/${ARCH}"; $
|
419 |
| - cp "${BUILD_DIR}/Foundation/Foundation.swiftmodule" "${DSTROOT}/${PREFIX}/lib/swift/${OS}/${ARCH}/"; $ |
420 |
| - cp "${BUILD_DIR}/Foundation/Foundation.swiftdoc" "${DSTROOT}/${PREFIX}/lib/swift/${OS}/${ARCH}/"; $ |
| 421 | + cp "${BUILD_DIR}/${MODULE_NAME}/${MODULE_NAME}.swiftmodule" "${DSTROOT}/${PREFIX}/lib/swift/${OS}/${ARCH}/"; $ |
| 422 | + cp "${BUILD_DIR}/${MODULE_NAME}/${MODULE_NAME}.swiftdoc" "${DSTROOT}/${PREFIX}/lib/swift/${OS}/${ARCH}/"; $ |
421 | 423 | mkdir -p "${DSTROOT}/${PREFIX}/local/include"; $
|
422 |
| - rsync -r "${BUILD_DIR}/Foundation/${PREFIX}/lib/swift/CoreFoundation" "${DSTROOT}/${PREFIX}/lib/swift/" |
| 424 | + rsync -r "${BUILD_DIR}/${MODULE_NAME}/${PREFIX}/lib/swift/CoreFoundation" "${DSTROOT}/${PREFIX}/lib/swift/" |
423 | 425 |
|
424 |
| -build ${BUILD_DIR}/.install: InstallFoundation ${BUILD_DIR}/Foundation/${DYLIB_PREFIX}Foundation${DYLIB_SUFFIX} |
| 426 | +build ${BUILD_DIR}/.install: InstallFoundation ${BUILD_DIR}/${MODULE_NAME}/${DYLIB_PREFIX}${MODULE_NAME}${DYLIB_SUFFIX} |
425 | 427 |
|
426 | 428 | build install: phony | ${BUILD_DIR}/.install
|
427 | 429 |
|
428 | 430 | """
|
429 | 431 | if "XCTEST_BUILD_DIR" in Configuration.current.variables:
|
430 | 432 | extra_script += """
|
431 | 433 | rule RunTestFoundation
|
432 |
| - command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/:${XCTEST_BUILD_DIR} ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/:${XCTEST_BUILD_DIR} lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n" |
| 434 | + command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/${MODULE_NAME}/:${XCTEST_BUILD_DIR} ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/${MODULE_NAME}/:${XCTEST_BUILD_DIR} lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n" |
433 | 435 | description = Building Tests
|
434 | 436 |
|
435 | 437 | build ${BUILD_DIR}/.test: RunTestFoundation | TestFoundation
|
|
440 | 442 | else:
|
441 | 443 | extra_script += """
|
442 | 444 | rule RunTestFoundation
|
443 |
| - command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/ ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/ lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n" |
| 445 | + command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/${MODULE_NAME}/ ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/${MODULE_NAME}/ lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n" |
444 | 446 | description = Building Tests
|
445 | 447 |
|
446 | 448 | build ${BUILD_DIR}/.test: RunTestFoundation | TestFoundation
|
|
0 commit comments