Skip to content

Shorten command line lengths #82074

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
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
10 changes: 8 additions & 2 deletions Runtimes/Core/cmake/modules/AvailabilityMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configure_file("${SwiftCore_SWIFTC_SOURCE_DIR}/utils/availability-macros.def"
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/availability-macros.def" availability_defs)
list(FILTER availability_defs EXCLUDE REGEX "^\\s*(#.*)?$")
foreach(def ${availability_defs})
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -define-availability -Xfrontend \"${def}\">")
list(APPEND availability_definitions "-Xfrontend -define-availability -Xfrontend \"${def}\"")

if("${def}" MATCHES "SwiftStdlib .*")
# For each SwiftStdlib x.y, also define StdlibDeploymentTarget x.y, which,
Expand All @@ -31,6 +31,12 @@ foreach(def ${availability_defs})
endif()
endif()
endif()
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -define-availability -Xfrontend \"${current}\">")
list(APPEND availability_definitions "-Xfrontend -define-availability -Xfrontend \"${current}\"")
endif()
endforeach()

list(JOIN availability_definitions "\n" availability_definitions)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/availability-macros.rsp"
CONTENT "${availability_definitions}")
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:${CMAKE_Swift_RESPONSE_FILE_FLAG}${CMAKE_CURRENT_BINARY_DIR}/availability-macros.rsp>")
1 change: 1 addition & 0 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,7 @@ function Build-ExperimentalRuntime {
CMAKE_Swift_COMPILER_WORKS = "YES";
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
CMAKE_NINJA_FORCE_RESPONSE_FILE = "YES";

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