-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Swift module name overrides on ABI CMake targets (#467)
- Loading branch information
1 parent
2d603ec
commit 9cfb305
Showing
3 changed files
with
46 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
struct CMakeOptions { | ||
public var dynamicLibraries: Bool | ||
public var moduleTargetNameOverrides: [String: String] | ||
|
||
public func getTargetName(moduleName: String) -> String { | ||
moduleTargetNameOverrides[moduleName] ?? moduleName | ||
} | ||
|
||
public init?(commandLineArguments: CommandLineArguments, projectionConfig: ProjectionConfig) { | ||
guard commandLineArguments.generateCMakeLists else { return nil } | ||
|
||
self.dynamicLibraries = commandLineArguments.dynamicLibraries | ||
|
||
self.moduleTargetNameOverrides = .init() | ||
for (moduleName, moduleConfig) in projectionConfig.modules { | ||
if let targetName = moduleConfig.cmakeTargetName { | ||
self.moduleTargetNameOverrides[moduleName] = targetName | ||
} | ||
} | ||
} | ||
} |
72 changes: 25 additions & 47 deletions
72
...urces/SwiftWinRT/BuildSystemOptions.swift → ...rator/Sources/SwiftWinRT/SPMOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,25 @@ | ||
struct SPMOptions { | ||
public var supportPackageReference: String | ||
public var dynamicLibraries: Bool | ||
public var excludeCMakeLists: Bool | ||
public var moduleLibraryNameOverrides: [String: String] | ||
|
||
public func getLibraryName(moduleName: String) -> String { | ||
moduleLibraryNameOverrides[moduleName] ?? moduleName | ||
} | ||
|
||
public init?(commandLineArguments: CommandLineArguments, projectionConfig: ProjectionConfig) { | ||
guard commandLineArguments.generatePackageDotSwift else { return nil } | ||
|
||
self.supportPackageReference = commandLineArguments.spmSupportPackageReference | ||
self.dynamicLibraries = commandLineArguments.dynamicLibraries | ||
self.excludeCMakeLists = !commandLineArguments.generateCMakeLists | ||
|
||
self.moduleLibraryNameOverrides = .init() | ||
for (moduleName, moduleConfig) in projectionConfig.modules { | ||
if let libraryName = moduleConfig.spmLibraryName { | ||
self.moduleLibraryNameOverrides[moduleName] = libraryName | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct CMakeOptions { | ||
public var dynamicLibraries: Bool | ||
public var moduleTargetNameOverrides: [String: String] | ||
|
||
public func getTargetName(moduleName: String) -> String { | ||
moduleTargetNameOverrides[moduleName] ?? moduleName | ||
} | ||
|
||
public init?(commandLineArguments: CommandLineArguments, projectionConfig: ProjectionConfig) { | ||
guard commandLineArguments.generateCMakeLists else { return nil } | ||
|
||
self.dynamicLibraries = commandLineArguments.dynamicLibraries | ||
|
||
self.moduleTargetNameOverrides = .init() | ||
for (moduleName, moduleConfig) in projectionConfig.modules { | ||
if let targetName = moduleConfig.cmakeTargetName { | ||
self.moduleTargetNameOverrides[moduleName] = targetName | ||
} | ||
} | ||
} | ||
} | ||
struct SPMOptions { | ||
public var supportPackageReference: String | ||
public var dynamicLibraries: Bool | ||
public var excludeCMakeLists: Bool | ||
public var moduleLibraryNameOverrides: [String: String] | ||
|
||
public func getLibraryName(moduleName: String) -> String { | ||
moduleLibraryNameOverrides[moduleName] ?? moduleName | ||
} | ||
|
||
public init?(commandLineArguments: CommandLineArguments, projectionConfig: ProjectionConfig) { | ||
guard commandLineArguments.generatePackageDotSwift else { return nil } | ||
|
||
self.supportPackageReference = commandLineArguments.spmSupportPackageReference | ||
self.dynamicLibraries = commandLineArguments.dynamicLibraries | ||
self.excludeCMakeLists = !commandLineArguments.generateCMakeLists | ||
|
||
self.moduleLibraryNameOverrides = .init() | ||
for (moduleName, moduleConfig) in projectionConfig.modules { | ||
if let libraryName = moduleConfig.spmLibraryName { | ||
self.moduleLibraryNameOverrides[moduleName] = libraryName | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters