Skip to content

Commit c43943d

Browse files
committed
[build-script] Remove -X option for "edit-only" Xcode projects.
This has caused plenty of confusion and should no longer be necessary anyway.
1 parent a5b0270 commit c43943d

File tree

5 files changed

+17
-76
lines changed

5 files changed

+17
-76
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,6 @@ if(SWIFT_SERIALIZE_STDLIB_UNITTEST AND SWIFT_STDLIB_ENABLE_RESILIENCE)
211211
set(SWIFT_SERIALIZE_STDLIB_UNITTEST FALSE)
212212
endif()
213213

214-
option(SWIFT_XCODE_GENERATE_FOR_IDE_ONLY
215-
"Generate an Xcode project suitable for IDE use, but which cannot build"
216-
FALSE)
217-
218214
#
219215
# End of user-configurable options.
220216
#

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,20 @@ To find out more:
139139
Note: Arguments after "--" above are forwarded to `build-script-impl`, which is
140140
the ultimate shell script that invokes the actual build and test commands.
141141

142-
A basic command to build Swift and run basic tests with Ninja:
142+
A basic command to build Swift with optimizations and run basic tests with
143+
Ninja:
143144

144-
utils/build-script -t
145+
utils/build-script -r -t
145146

146147
## Developing Swift in Xcode
147148

148-
The Xcode IDE can be used to edit the Swift source code, but it is not currently
149-
fully supported as a build environment for SDKs other than OS X. If you'd like
150-
to build for other SDKs but still use Xcode, once you've built Swift using Ninja
151-
or one of the other supported CMake generators, you can set up an IDE-only Xcode
152-
environment using the build-script's `-X` flag:
153-
154-
utils/build-script -X --skip-build -- --reconfigure
149+
`build-script` can also generate Xcode projects:
155150

156-
The `--skip-build` flag tells `build-script` to only generate the project,
157-
not build it in its entirety. A bare minimum of LLVM tools will build in order
158-
to configure the Xcode projects.
151+
utils/build-script -x
159152

160-
The `--reconfigure` flag tells `build-script-impl` to run the CMake configuration
161-
step even if there is a cached configuration. As you develop in Xcode, you may
162-
need to rerun this from time to time to refresh your generated Xcode project,
163-
picking up new targets, file removals, or file additions.
153+
The Xcode IDE can be used to edit the Swift source code, but it is not currently
154+
fully supported as a build environment for SDKs other than OS X. If you need to
155+
work with other SDKs, you'll need to create a second build using Ninja.
164156

165157
## Testing Swift
166158

cmake/modules/SwiftAddCustomCommandTarget.cmake

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -147,38 +147,16 @@ function(add_custom_command_target dependency_out_var_name)
147147
IMPLICIT_DEPENDS WORKING_DIRECTORY COMMENT VERBATIM APPEND)
148148
add_custom_command(${ACCT_COMMANDS} ${args})
149149

150-
# Skip generating the target if we are generating an Xcode project only
151-
# for IDE use. The volume of dependencies here causes performance problems
152-
# in Xcode that make it impractical to use.
153-
if(NOT (SWIFT_XCODE_GENERATE_FOR_IDE_ONLY
154-
AND "${ACCT_CUSTOM_TARGET_NAME}" STREQUAL ""))
155-
_make_acct_argument_list(ALL WORKING_DIRECTORY SOURCES)
156-
add_custom_target(
157-
"${target_name}" ${args}
158-
DEPENDS ${ACCT_OUTPUT}
159-
COMMENT "${ACCT_OUTPUT}")
160-
set_target_properties(
161-
"${target_name}" PROPERTIES
162-
FOLDER "add_custom_command_target artifacts")
163-
endif()
150+
_make_acct_argument_list(ALL WORKING_DIRECTORY SOURCES)
151+
add_custom_target(
152+
"${target_name}" ${args}
153+
DEPENDS ${ACCT_OUTPUT}
154+
COMMENT "${ACCT_OUTPUT}")
155+
set_target_properties(
156+
"${target_name}" PROPERTIES
157+
FOLDER "add_custom_command_target artifacts")
164158
endif()
165159

166160
# "Return" the name of the custom target
167-
if(SWIFT_XCODE_GENERATE_FOR_IDE_ONLY
168-
AND "${ACCT_CUSTOM_TARGET_NAME}" STREQUAL "")
169-
set("${dependency_out_var_name}" xcode_generate_for_ide_only_dummy
170-
PARENT_SCOPE)
171-
else()
172-
set("${dependency_out_var_name}" "${target_name}" PARENT_SCOPE)
173-
endif()
161+
set("${dependency_out_var_name}" "${target_name}" PARENT_SCOPE)
174162
endfunction()
175-
176-
# A dummy target for XCODE_GENERATE_FOR_IDE_ONLY targets that stands in for
177-
# the targets we don't generate in that mode.
178-
if(SWIFT_XCODE_GENERATE_FOR_IDE_ONLY)
179-
add_custom_command(OUTPUT xcode_generate_for_ide_only_dummy.txt
180-
COMMAND echo "This Xcode project is configured for IDE use only and cannot build Swift."
181-
COMMAND false)
182-
add_custom_target(xcode_generate_for_ide_only_dummy ALL
183-
DEPENDS xcode_generate_for_ide_only_dummy.txt)
184-
endif()

utils/build-script

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,6 @@ To create Xcode projects that can build Swift, use '-x':
240240
241241
[~/src/s]$ ./swift/utils/build-script -x -R
242242
243-
The Xcode IDE may have performance issues with this configuration. To create
244-
slimmer Xcode projects that can edit Swift compiler source, but cannot build,
245-
use '-X' instead:
246-
247-
[~/src/s]$ ./swift/utils/build-script -X -R
248-
249243
Preset mode in build-script
250244
---------------------------
251245
@@ -509,12 +503,6 @@ build the Debug variant of the Swift standard library and SDK overlay""",
509503
action="store_const",
510504
const="Xcode",
511505
dest="cmake_generator")
512-
cmake_generator_group.add_argument(
513-
"-X", "--xcode-ide-only",
514-
help="use CMake's Xcode generator, with only IDE support (no build)",
515-
action="store_const",
516-
const="XcodeIDEOnly",
517-
dest="cmake_generator")
518506
cmake_generator_group.add_argument(
519507
"-m", "--make",
520508
help="use CMake's Makefile generator (default is Ninja)",
@@ -836,12 +824,6 @@ the number of parallel build jobs to use""",
836824
"--export-compile-commands"
837825
]
838826

839-
if args.cmake_generator == "XcodeIDEOnly":
840-
args.cmake_generator = "Xcode"
841-
build_script_impl_inferred_args += [
842-
"--xcode-ide-only"
843-
]
844-
845827
if not args.test:
846828
build_script_impl_inferred_args += [
847829
"--skip-test-cmark",

utils/build-script-impl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ KNOWN_SETTINGS=(
148148
skip-test-benchmarks "" "set to skip running Swift Benchmark Suite"
149149
skip-test-optimized "" "set to skip testing the test suite in optimized mode"
150150
stress-test-sourcekit "" "set to run the stress-SourceKit target"
151-
xcode-ide-only "" "set to configure Xcode project for IDE use only, not building"
152151
workspace "${HOME}/src" "source directory containing llvm, clang, swift"
153152
enable-llvm-assertions "1" "set to enable llvm assertions"
154153
build-llvm "1" "set to 1 to build LLVM and Clang"
@@ -1210,12 +1209,6 @@ case "${CMAKE_GENERATOR}" in
12101209
"${COMMON_CMAKE_OPTIONS[@]}"
12111210
-DCMAKE_CONFIGURATION_TYPES="Debug;Release;MinSizeRel;RelWithDebInfo"
12121211
)
1213-
if [[ "${XCODE_IDE_ONLY}" ]]; then
1214-
COMMON_CMAKE_OPTIONS=(
1215-
"${COMMON_CMAKE_OPTIONS[@]}"
1216-
-DSWIFT_XCODE_GENERATE_FOR_IDE_ONLY=ON
1217-
)
1218-
fi
12191212
;;
12201213
esac
12211214

0 commit comments

Comments
 (0)