Skip to content

Add an option to specify the install prefix for CoreFoundation depend… #106

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

Merged
merged 1 commit into from
May 16, 2016
Merged
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
25 changes: 20 additions & 5 deletions build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def build(args):
build_dir = os.path.abspath(args.build_dir)
foundation_build_dir = os.path.abspath(args.foundation_build_dir)
core_foundation_build_dir = GenericUnixStrategy.core_foundation_build_dir(
foundation_build_dir)
foundation_build_dir, args.foundation_install_prefix)
if args.libdispatch_build_dir:
libdispatch_build_dir = os.path.abspath(args.libdispatch_build_dir)
if args.libdispatch_src_dir:
Expand Down Expand Up @@ -201,7 +201,7 @@ def test(args):
tests_path = os.path.join(SOURCE_DIR, "Tests", "Functional")
foundation_build_dir = os.path.abspath(args.foundation_build_dir)
core_foundation_build_dir = GenericUnixStrategy.core_foundation_build_dir(
foundation_build_dir)
foundation_build_dir, args.foundation_install_prefix)

run('SWIFT_EXEC={swiftc} '
'BUILT_PRODUCTS_DIR={built_products_dir} '
Expand Down Expand Up @@ -246,7 +246,7 @@ def install(args):
os.path.join(module_install_path, xctest_swiftdoc)))

@staticmethod
def core_foundation_build_dir(foundation_build_dir):
def core_foundation_build_dir(foundation_build_dir, foundation_install_prefix):
"""
Given the path to a swift-corelibs-foundation built product directory,
return the path to CoreFoundation built products.
Expand All @@ -257,7 +257,8 @@ def core_foundation_build_dir(foundation_build_dir):
include this extra path when linking the installed Swift's
'usr/lib/swift/linux/libFoundation.so'.
"""
return os.path.join(foundation_build_dir, 'usr', 'lib', 'swift')
return os.path.join(foundation_build_dir,
foundation_install_prefix.strip("/"), 'lib', 'swift')


def main(args=sys.argv[1:]):
Expand Down Expand Up @@ -320,13 +321,20 @@ def main(args=sys.argv[1:]):
build_parser.add_argument(
"--build-dir",
help="Path to the output build directory. If not specified, a "
"temporary directory is used",
"temporary directory is used.",
default=tempfile.mkdtemp())
build_parser.add_argument(
"--foundation-build-dir",
help="Path to swift-corelibs-foundation build products, which "
"the built XCTest.so will be linked against.",
required=strategy.requires_foundation_build_dir())
build_parser.add_argument(
"--foundation-install-prefix",
help="Path to the installation location for swift-corelibs-foundation "
"build products ('%(default)s' by default); CoreFoundation "
"dependencies are expected to be found under "
"FOUNDATION_BUILD_DIR/FOUNDATION_INSTALL_PREFIX.",
default="/usr")
build_parser.add_argument(
"--libdispatch-build-dir",
help="Path to swift-corelibs-libdispatch build products, which "
Expand Down Expand Up @@ -394,6 +402,13 @@ def main(args=sys.argv[1:]):
help="Path to swift-corelibs-foundation build products, which the "
"tests will be linked against.",
required=strategy.requires_foundation_build_dir())
test_parser.add_argument(
"--foundation-install-prefix",
help="Path to the installation location for swift-corelibs-foundation "
"build products ('%(default)s' by default); CoreFoundation "
"dependencies are expected to be found under "
"FOUNDATION_BUILD_DIR/FOUNDATION_INSTALL_PREFIX.",
default="/usr")

install_parser = subparsers.add_parser(
"install",
Expand Down