Skip to content

Commit 6bef9e9

Browse files
authored
Merge pull request #82074 from etcwilde/ewilde/shorten-command-line-lenghts
Shorten command line lengths
2 parents bc655eb + 9360398 commit 6bef9e9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Runtimes/Core/cmake/modules/AvailabilityMacros.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configure_file("${SwiftCore_SWIFTC_SOURCE_DIR}/utils/availability-macros.def"
44
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/availability-macros.def" availability_defs)
55
list(FILTER availability_defs EXCLUDE REGEX "^\\s*(#.*)?$")
66
foreach(def ${availability_defs})
7-
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -define-availability -Xfrontend \"${def}\">")
7+
list(APPEND availability_definitions "-Xfrontend -define-availability -Xfrontend \"${def}\"")
88

99
if("${def}" MATCHES "SwiftStdlib .*")
1010
# For each SwiftStdlib x.y, also define StdlibDeploymentTarget x.y, which,
@@ -31,6 +31,12 @@ foreach(def ${availability_defs})
3131
endif()
3232
endif()
3333
endif()
34-
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -define-availability -Xfrontend \"${current}\">")
34+
list(APPEND availability_definitions "-Xfrontend -define-availability -Xfrontend \"${current}\"")
3535
endif()
3636
endforeach()
37+
38+
list(JOIN availability_definitions "\n" availability_definitions)
39+
file(GENERATE
40+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/availability-macros.rsp"
41+
CONTENT "${availability_definitions}")
42+
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:${CMAKE_Swift_RESPONSE_FILE_FLAG}${CMAKE_CURRENT_BINARY_DIR}/availability-macros.rsp>")

utils/build.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,7 @@ function Build-ExperimentalRuntime {
23382338
CMAKE_Swift_COMPILER_WORKS = "YES";
23392339
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
23402340
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
2341+
CMAKE_NINJA_FORCE_RESPONSE_FILE = "YES";
23412342

23422343
# NOTE(compnerd) we can get away with this currently because we only
23432344
# use the C portion of the dispatch build, which is always built

0 commit comments

Comments
 (0)