Skip to content

[SR-14718] Only pass -enable-library-evolution for PackageDescription and PackagePlugin on macOS #3526

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ let package = Package(
name: "PackageDescription",
swiftSettings: [
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"])
.unsafeFlags(["-enable-library-evolution"], .when(platforms: [.macOS]))
]),

// The `PackagePlugin` target provides the API that is available to
Expand All @@ -125,7 +125,7 @@ let package = Package(
name: "PackagePlugin",
swiftSettings: [
.unsafeFlags(["-package-description-version", "999.0"]),
.unsafeFlags(["-enable-library-evolution"])
.unsafeFlags(["-enable-library-evolution"], .when(platforms: [.macOS]))
]),

// MARK: SwiftPM specific support libraries
Expand Down
4 changes: 2 additions & 2 deletions Sources/PackageDescription/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ add_library(PackageDescription

target_compile_options(PackageDescription PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-package-description-version$<SEMICOLON>999.0>)
target_compile_options(PackageDescription PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-enable-library-evolution>)

if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
target_compile_options(PackageDescription PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-enable-library-evolution>)
set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/ManifestAPI/PackageDescription.swiftinterface)
target_compile_options(PackageDescription PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-emit-module-interface-path$<SEMICOLON>${SWIFT_INTERFACE_PATH}>)
Expand Down
4 changes: 2 additions & 2 deletions Sources/PackagePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ add_library(PackagePlugin

target_compile_options(PackagePlugin PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-package-description-version$<SEMICOLON>999.0>)
target_compile_options(PackagePlugin PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-enable-library-evolution>)

if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
target_compile_options(PackagePlugin PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-enable-library-evolution>)
set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftinterface)
target_compile_options(PackagePlugin PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-emit-module-interface-path$<SEMICOLON>${SWIFT_INTERFACE_PATH}>)
Expand Down