Skip to content

[libcxx] Simplify the conditions for building libcxx #22404

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
Feb 6, 2019
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
2 changes: 2 additions & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ llbuild
swiftpm
xctest
libicu
libcxx

dash-dash

Expand Down Expand Up @@ -1034,6 +1035,7 @@ swiftsyntax
skstresstester
swiftevolve
playgroundsupport
libcxx

# Build with debug info, this allows us to symbolicate crashes from
# production builds.
Expand Down
5 changes: 4 additions & 1 deletion utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ class BuildScriptInvocation(object):
impl_args += ["--skip-build-lldb"]
if not args.build_llbuild:
impl_args += ["--skip-build-llbuild"]
if not args.build_libcxx:
impl_args += ["--skip-build-libcxx"]
if not args.build_libdispatch:
impl_args += ["--skip-build-libdispatch"]
if not args.build_libicu:
Expand Down Expand Up @@ -841,7 +843,8 @@ class BuildScriptInvocation(object):
product_classes = []
product_classes.append(products.CMark)
product_classes.append(products.LLVM)
product_classes.append(products.LibCXX)
if self.args.build_libcxx:
product_classes.append(products.LibCXX)
if self.args.build_libicu:
product_classes.append(products.LibICU)
product_classes.append(products.Swift)
Expand Down
8 changes: 2 additions & 6 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ KNOWN_SETTINGS=(
skip-build-android "" "set to skip building Swift stdlibs for Android"
skip-build-lldb "" "set to skip building LLDB"
skip-build-llbuild "" "set to skip building llbuild"
skip-build-libcxx "" "set to skip building libcxx"
skip-build-swiftpm "" "set to skip building swiftpm"
skip-build-swiftsyntax "" "set to skip building swiftSyntax"
skip-build-skstresstester "" "set to skip building the SourceKit stress tester"
Expand Down Expand Up @@ -1203,6 +1204,7 @@ FOUNDATION_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-foundation"
LIBDISPATCH_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
LIBDISPATCH_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
LIBICU_SOURCE_DIR="${WORKSPACE}/icu"
LIBCXX_SOURCE_DIR="${WORKSPACE}/libcxx"
PLAYGROUNDSUPPORT_SOURCE_DIR="${WORKSPACE}/swift-xcode-playground-support"

if [[ ! "${SKIP_BUILD_PLAYGROUNDSUPPORT}" && ! -d ${PLAYGROUNDSUPPORT_SOURCE_DIR} ]]; then
Expand Down Expand Up @@ -1237,12 +1239,6 @@ if [ -e "${WORKSPACE}/compiler-rt" ] ; then
fi
fi

# Build libcxx, unless it doesn't exist.
LIBCXX_SOURCE_DIR="${WORKSPACE}/libcxx"
if [[ ! -e "${LIBCXX_SOURCE_DIR}" ]] ; then
SKIP_BUILD_LIBCXX=1
fi

PRODUCTS=(cmark llvm)
if [[ ! "${SKIP_BUILD_LIBCXX}" ]] ; then
PRODUCTS=("${PRODUCTS[@]}" libcxx)
Expand Down
4 changes: 4 additions & 0 deletions utils/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def _apply_default_arguments(args):
args.build_external_benchmarks = False
args.build_lldb = False
args.build_llbuild = False
args.build_libcxx = False
args.build_swiftpm = False
args.build_xctest = False
args.build_foundation = False
Expand Down Expand Up @@ -512,6 +513,9 @@ def create_argument_parser():
option(['-b', '--llbuild'], store_true('build_llbuild'),
help='build llbuild')

option(['--libcxx'], store_true('build_libcxx'),
help='build libcxx')

option(['-p', '--swiftpm'], store_true('build_swiftpm'),
help='build swiftpm')

Expand Down
2 changes: 2 additions & 0 deletions utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
'build_linux': True,
'build_llbuild': False,
'build_lldb': False,
'build_libcxx': False,
'build_ninja': False,
'build_osx': True,
'build_playgroundsupport': False,
Expand Down Expand Up @@ -397,6 +398,7 @@ class IgnoreOption(_BaseOption):
SetTrueOption('--ios'),
SetTrueOption('--llbuild', dest='build_llbuild'),
SetTrueOption('--lldb', dest='build_lldb'),
SetTrueOption('--libcxx', dest='build_libcxx'),
SetTrueOption('--playgroundsupport', dest='build_playgroundsupport'),
SetTrueOption('--skip-build'),
SetTrueOption('--swiftpm', dest='build_swiftpm'),
Expand Down
1 change: 1 addition & 0 deletions utils/build_swift/tests/test_driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ def test_implied_defaults_skip_build(self):
self.assertFalse(namespace.build_libicu)
self.assertFalse(namespace.build_lldb)
self.assertFalse(namespace.build_llbuild)
self.assertFalse(namespace.build_libcxx)
self.assertFalse(namespace.build_playgroundsupport)
self.assertFalse(namespace.build_swiftpm)
self.assertFalse(namespace.build_xctest)
Expand Down