mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
build: Override default build variant for --xcode
This commit is contained in:
@@ -357,7 +357,7 @@ while retaining the option of building with Ninja on the command line.
|
|||||||
|
|
||||||
Assuming that you have already [built the toolchain via Ninja](#the-actual-build),
|
Assuming that you have already [built the toolchain via Ninja](#the-actual-build),
|
||||||
several more steps are necessary to set up this environment:
|
several more steps are necessary to set up this environment:
|
||||||
* Generate Xcode projects with `utils/build-script --release --swift-darwin-supported-archs "$(uname -m)" --xcode --clean`.
|
* Generate Xcode projects with `utils/build-script --swift-darwin-supported-archs "$(uname -m)" --xcode --clean`.
|
||||||
This will first build a few LLVM files that are needed to configure the
|
This will first build a few LLVM files that are needed to configure the
|
||||||
projects.
|
projects.
|
||||||
* Create a new Xcode workspace.
|
* Create a new Xcode workspace.
|
||||||
|
|||||||
@@ -56,9 +56,20 @@ def _apply_default_arguments(args):
|
|||||||
args.lldb_build_with_xcode is not None:
|
args.lldb_build_with_xcode is not None:
|
||||||
args.build_lldb = True
|
args.build_lldb = True
|
||||||
|
|
||||||
|
# Set the default CMake generator.
|
||||||
|
if args.cmake_generator is None:
|
||||||
|
args.cmake_generator = 'Ninja'
|
||||||
|
elif args.cmake_generator == 'Xcode':
|
||||||
|
# Building with Xcode is deprecated.
|
||||||
|
args.skip_build = True
|
||||||
|
args.build_early_swift_driver = False
|
||||||
|
args.build_early_swiftsyntax = False
|
||||||
|
|
||||||
# Set the default build variant.
|
# Set the default build variant.
|
||||||
if args.build_variant is None:
|
if args.build_variant is None:
|
||||||
args.build_variant = 'Debug'
|
args.build_variant = (
|
||||||
|
'MinSizeRel' if args.cmake_generator == 'Xcode' else 'Debug'
|
||||||
|
)
|
||||||
|
|
||||||
if args.llvm_build_variant is None:
|
if args.llvm_build_variant is None:
|
||||||
args.llvm_build_variant = args.build_variant
|
args.llvm_build_variant = args.build_variant
|
||||||
@@ -119,15 +130,6 @@ def _apply_default_arguments(args):
|
|||||||
if args.lldb_assertions is None:
|
if args.lldb_assertions is None:
|
||||||
args.lldb_assertions = args.assertions
|
args.lldb_assertions = args.assertions
|
||||||
|
|
||||||
# Set the default CMake generator.
|
|
||||||
if args.cmake_generator is None:
|
|
||||||
args.cmake_generator = 'Ninja'
|
|
||||||
elif args.cmake_generator == 'Xcode':
|
|
||||||
# Building with Xcode is deprecated.
|
|
||||||
args.skip_build = True
|
|
||||||
args.build_early_swift_driver = False
|
|
||||||
args.build_early_swiftsyntax = False
|
|
||||||
|
|
||||||
# --ios-all etc are not supported by open-source Swift.
|
# --ios-all etc are not supported by open-source Swift.
|
||||||
if args.ios_all:
|
if args.ios_all:
|
||||||
raise ValueError('error: --ios-all is unavailable in open-source '
|
raise ValueError('error: --ios-all is unavailable in open-source '
|
||||||
|
|||||||
@@ -644,6 +644,7 @@ class TestDriverArgumentParser(
|
|||||||
def test_implied_defaults_xcode(self):
|
def test_implied_defaults_xcode(self):
|
||||||
namespace = self.parse_default_args(['--xcode'])
|
namespace = self.parse_default_args(['--xcode'])
|
||||||
self.assertEqual(namespace.cmake_generator, 'Xcode')
|
self.assertEqual(namespace.cmake_generator, 'Xcode')
|
||||||
|
self.assertEqual(namespace.build_variant, 'MinSizeRel')
|
||||||
self.assertTrue(namespace.skip_build)
|
self.assertTrue(namespace.skip_build)
|
||||||
self.assertFalse(namespace.build_early_swift_driver)
|
self.assertFalse(namespace.build_early_swift_driver)
|
||||||
self.assertFalse(namespace.build_early_swiftsyntax)
|
self.assertFalse(namespace.build_early_swiftsyntax)
|
||||||
|
|||||||
Reference in New Issue
Block a user