Skip to content

[Bootstrap] Add optional flags for Dispatch and Foundation build directories #2742

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
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
22 changes: 22 additions & 0 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def add_build_args(parser):
'--ninja-path',
metavar='PATH',
help='path to the ninja binary to use for building with CMake')
parser.add_argument(
"--dispatch-build-dir",
help="path to Dispatch build directory")
parser.add_argument(
"--foundation-build-dir",
help="path to Foundation build directory")
parser.add_argument(
"--llbuild-build-dir",
help="path to llbuild build directory")
Expand Down Expand Up @@ -155,6 +161,12 @@ def parse_build_args(args):
"""Parses and cleans arguments necessary for build-related actions."""
parse_global_args(args)

if args.dispatch_build_dir:
args.dispatch_build_dir = os.path.abspath(args.dispatch_build_dir)

if args.foundation_build_dir:
args.foundation_build_dir = os.path.abspath(args.foundation_build_dir)

if args.llbuild_build_dir:
args.llbuild_build_dir = os.path.abspath(args.llbuild_build_dir)

Expand Down Expand Up @@ -485,6 +497,16 @@ def call_swiftpm(args, cmd, cwd=None):
# Build-related helper functions
# -----------------------------------------------------------

def get_dispatch_cmake_arg(args):
"""Returns the CMake argument to the Dispatch configuration to use for bulding SwiftPM."""
dispatch_dir = os.path.join(args.dispatch_build_dir, "cmake/modules")
return "-Ddispatch_DIR=" + dispatch_dir

def get_foundation_cmake_arg(args):
"""Returns the CMake argument to the Foundation configuration to use for bulding SwiftPM."""
foundation_dir = os.path.join(args.foundation_build_dir, "cmake/modules")
return "-DFoundation_DIR=" + foundation_dir

def get_llbuild_cmake_arg(args):
"""Returns the CMake argument to the LLBuild framework/binary to use for bulding SwiftPM."""
if args.llbuild_link_framework:
Expand Down