Skip to content

stdlib: prevent static builds on Darwin #26210

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 1 commit into from
Jul 24, 2019
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
7 changes: 6 additions & 1 deletion stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ if(SWIFT_BUILD_DYNAMIC_STDLIB)
list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES SHARED)
endif()
if(SWIFT_BUILD_STATIC_STDLIB)
list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES STATIC)
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}" building_darwin_sdks)
if(building_darwin_sdks)
message(SEND_ERROR "cannot build static standard library for Darwin SDKs")
else()
list(APPEND SWIFT_STDLIB_LIBRARY_BUILD_TYPES STATIC)
endif()
endif()

function(swift_create_stdlib_targets name variant define_all_alias)
Expand Down
7 changes: 6 additions & 1 deletion stdlib/public/Darwin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ if(SWIFT_BUILD_DYNAMIC_SDK_OVERLAY)
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES SHARED)
endif()
if(SWIFT_BUILD_STATIC_SDK_OVERLAY)
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}" building_darwin_sdks)
if(building_darwin_sdks)
message(SEND_ERROR "cannot build static standard library for Darwin SDKs")
else()
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
endif()
endif()

set(all_overlays
Expand Down