diff --git a/Generator/Sources/CodeWriters/CMake/CMakeListsWriter.swift b/Generator/Sources/CodeWriters/CMake/CMakeListsWriter.swift index f4fbbd41..d79ece9a 100644 --- a/Generator/Sources/CodeWriters/CMake/CMakeListsWriter.swift +++ b/Generator/Sources/CodeWriters/CMake/CMakeListsWriter.swift @@ -6,7 +6,7 @@ public final class CMakeListsWriter { } public func writeAddLibrary(_ name: String, _ type: CMakeLibraryType? = nil, _ sources: [String] = []) { - let typeSuffix = type.map { " \($0)" } ?? "" + let typeSuffix = type.map { " \($0.rawValue)" } ?? "" output.writeIndentedBlock(grouping: .never, header: "add_library(\(name)\(typeSuffix)", footer: ")") { for source in sources { output.writeFullLine(source) @@ -16,7 +16,7 @@ public final class CMakeListsWriter { public func writeTargetIncludeDirectories(_ target: String, _ visibility: CMakeVisibility, _ directories: [String]) { guard !directories.isEmpty else { return } - output.writeIndentedBlock(grouping: .never, header: "target_include_directories(\(target) \(visibility)", footer: ")") { + output.writeIndentedBlock(grouping: .never, header: "target_include_directories(\(target) \(visibility.rawValue)", footer: ")") { for directory in directories { output.writeFullLine(directory) } @@ -25,14 +25,14 @@ public final class CMakeListsWriter { public func writeTargetLinkLibraries(_ target: String, _ visibility: CMakeVisibility, _ libraries: [String]) { guard !libraries.isEmpty else { return } - output.writeIndentedBlock(grouping: .never, header: "target_link_libraries(\(target) \(visibility)", footer: ")") { + output.writeIndentedBlock(grouping: .never, header: "target_link_libraries(\(target) \(visibility.rawValue)", footer: ")") { for library in libraries { output.writeFullLine(library) } } } - public func writeAddSubdirectory(_ subdirectory: String) { - output.writeFullLine(grouping: .withName("add_subdirectory"), "add_subdirectory(\(subdirectory))") + public func writeAddSubdirectory(_ sources: String) { + output.writeFullLine(grouping: .withName("add_subdirectory"), "add_subdirectory(\(sources))") } } \ No newline at end of file diff --git a/Generator/Sources/SwiftWinRT/Writing/ABIModule.swift b/Generator/Sources/SwiftWinRT/Writing/ABIModule.swift index 41756fba..e3db69fb 100644 --- a/Generator/Sources/SwiftWinRT/Writing/ABIModule.swift +++ b/Generator/Sources/SwiftWinRT/Writing/ABIModule.swift @@ -18,8 +18,8 @@ internal func writeABIModule(_ module: SwiftProjection.Module, directoryPath: St let cmakeListsWriter = CMakeListsWriter(output: FileTextOutputStream( path: "\(directoryPath)\\CMakeLists.txt", directoryCreation: .ancestors)) cmakeListsWriter.writeAddLibrary(module.abiModuleName, .interface) - cmakeListsWriter.writeTargetIncludeDirectories(module.abiModuleName, .public, ["include"]) - cmakeListsWriter.writeTargetLinkLibraries(module.abiModuleName, .public, + cmakeListsWriter.writeTargetIncludeDirectories(module.abiModuleName, .interface, ["include"]) + cmakeListsWriter.writeTargetLinkLibraries(module.abiModuleName, .interface, [ SupportModules.WinRT.abiModuleName ] + module.references.map { $0.abiModuleName }) } }