File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1974,6 +1974,12 @@ function(add_swift_target_library name)
1974
1974
WORLD_READ )
1975
1975
endif ()
1976
1976
1977
+ set (optional_arg )
1978
+ if (sdk IN_LIST SWIFT_APPLE_PLATFORMS )
1979
+ # Allow installation of stdlib without building all variants on Darwin.
1980
+ set (optional_arg "OPTIONAL" )
1981
+ endif ()
1982
+
1977
1983
if (sdk STREQUAL WINDOWS AND CMAKE_SYSTEM_NAME STREQUAL Windows )
1978
1984
swift_install_in_component ("${SWIFTLIB_INSTALL_IN_COMPONENT} "
1979
1985
TARGETS ${name} -windows-${SWIFT_PRIMARY_VARIANT_ARCH}
@@ -1986,7 +1992,7 @@ function(add_swift_target_library name)
1986
1992
FILES "${UNIVERSAL_LIBRARY_NAME} "
1987
1993
DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /${resource_dir} /${resource_dir_sdk_subdir} "
1988
1994
PERMISSIONS ${file_permissions}
1989
- OPTIONAL )
1995
+ " ${optional_arg} " )
1990
1996
endif ()
1991
1997
if (sdk STREQUAL WINDOWS )
1992
1998
foreach (arch ${SWIFT_SDK_WINDOWS_ARCHITECTURES} )
@@ -2034,7 +2040,7 @@ function(add_swift_target_library name)
2034
2040
OWNER_READ OWNER_WRITE
2035
2041
GROUP_READ
2036
2042
WORLD_READ
2037
- OPTIONAL )
2043
+ " ${optional_arg} " )
2038
2044
endif ()
2039
2045
2040
2046
# Add Swift standard library targets as dependencies to the top-level
Original file line number Diff line number Diff line change @@ -347,10 +347,16 @@ function(_compile_swift_files
347
347
list (APPEND module_outputs "${interface_file} " )
348
348
endif ()
349
349
350
+ set (optional_arg )
351
+ if (sdk IN_LIST SWIFT_APPLE_PLATFORMS )
352
+ # Allow installation of stdlib without building all variants on Darwin.
353
+ set (optional_arg "OPTIONAL" )
354
+ endif ()
355
+
350
356
swift_install_in_component ("${SWIFTFILE_INSTALL_IN_COMPONENT} "
351
357
FILES ${module_outputs}
352
358
DESTINATION "lib${LLVM_LIBDIR_SUFFIX} /swift/${library_subdir} "
353
- OPTIONAL )
359
+ " ${optional_arg} " )
354
360
355
361
set (line_directive_tool "${SWIFT_SOURCE_DIR} /utils/line-directive" )
356
362
set (swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH} /swiftc" )
You can’t perform that action at this time.
0 commit comments