Skip to content

Commit b8d032c

Browse files
authored
Merge pull request #2742 from DougGregor/bootstrap-dispatch-foundation-build-dirs
[Bootstrap] Add optional flags for Dispatch and Foundation build directories
2 parents 2768418 + 97b5502 commit b8d032c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Utilities/bootstrap

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ def add_build_args(parser):
102102
'--ninja-path',
103103
metavar='PATH',
104104
help='path to the ninja binary to use for building with CMake')
105+
parser.add_argument(
106+
"--dispatch-build-dir",
107+
help="path to Dispatch build directory")
108+
parser.add_argument(
109+
"--foundation-build-dir",
110+
help="path to Foundation build directory")
105111
parser.add_argument(
106112
"--llbuild-build-dir",
107113
help="path to llbuild build directory")
@@ -155,6 +161,12 @@ def parse_build_args(args):
155161
"""Parses and cleans arguments necessary for build-related actions."""
156162
parse_global_args(args)
157163

164+
if args.dispatch_build_dir:
165+
args.dispatch_build_dir = os.path.abspath(args.dispatch_build_dir)
166+
167+
if args.foundation_build_dir:
168+
args.foundation_build_dir = os.path.abspath(args.foundation_build_dir)
169+
158170
if args.llbuild_build_dir:
159171
args.llbuild_build_dir = os.path.abspath(args.llbuild_build_dir)
160172

@@ -485,6 +497,16 @@ def call_swiftpm(args, cmd, cwd=None):
485497
# Build-related helper functions
486498
# -----------------------------------------------------------
487499

500+
def get_dispatch_cmake_arg(args):
501+
"""Returns the CMake argument to the Dispatch configuration to use for bulding SwiftPM."""
502+
dispatch_dir = os.path.join(args.dispatch_build_dir, "cmake/modules")
503+
return "-Ddispatch_DIR=" + dispatch_dir
504+
505+
def get_foundation_cmake_arg(args):
506+
"""Returns the CMake argument to the Foundation configuration to use for bulding SwiftPM."""
507+
foundation_dir = os.path.join(args.foundation_build_dir, "cmake/modules")
508+
return "-DFoundation_DIR=" + foundation_dir
509+
488510
def get_llbuild_cmake_arg(args):
489511
"""Returns the CMake argument to the LLBuild framework/binary to use for bulding SwiftPM."""
490512
if args.llbuild_link_framework:

0 commit comments

Comments
 (0)