diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 36b4f38adb..a25133f712 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1289,11 +1289,9 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap( if (cmValue name = target->GetProperty("Swift_DEPENDENCIES_FILE")) { return *name; } - return this->GetLocalGenerator()->ConvertToOutputFormat( - this->ConvertToNinjaPath(cmStrCat(target->GetSupportDirectory(), '/', - config, '/', target->GetName(), - ".swiftdeps")), - cmOutputConverter::SHELL); + return this->ConvertToNinjaPath(cmStrCat(target->GetSupportDirectory(), + '/', config, '/', + target->GetName(), ".swiftdeps")); }(); std::string mapFilePath = @@ -1311,7 +1309,7 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap( // Add flag this->LocalGenerator->AppendFlags(flags, "-output-file-map"); - this->LocalGenerator->AppendFlagEscape( + this->LocalGenerator->AppendFlags( flags, this->GetLocalGenerator()->ConvertToOutputFormat( ConvertToNinjaPath(mapFilePath), cmOutputConverter::SHELL)); @@ -2014,7 +2012,10 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement( std::string const emitModuleFlag = "-emit-module"; std::string const modulePathFlag = "-emit-module-path"; this->LocalGenerator->AppendFlags( - vars["FLAGS"], { emitModuleFlag, modulePathFlag, moduleFilepath }); + vars["FLAGS"], + { emitModuleFlag, modulePathFlag, + this->LocalGenerator->ConvertToOutputFormat( + moduleFilepath, cmOutputConverter::SHELL) }); objBuild.Outputs.push_back(moduleFilepath); } this->LocalGenerator->AppendFlags(vars["FLAGS"], diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt index ba36c10b48..26f75f3517 100644 --- a/Tests/SwiftOnly/CMakeLists.txt +++ b/Tests/SwiftOnly/CMakeLists.txt @@ -32,6 +32,8 @@ add_subdirectory(SubC) add_subdirectory(SubD) add_subdirectory(SubE) +add_subdirectory("Sub Space") + set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift) add_executable(SwiftOnly main.swift) diff --git a/Tests/SwiftOnly/Sub Space/CMakeLists.txt b/Tests/SwiftOnly/Sub Space/CMakeLists.txt new file mode 100644 index 0000000000..ac4cd18441 --- /dev/null +++ b/Tests/SwiftOnly/Sub Space/CMakeLists.txt @@ -0,0 +1 @@ +add_library(SubSpace SubSpace.swift) diff --git a/Tests/SwiftOnly/Sub Space/SubSpace.swift b/Tests/SwiftOnly/Sub Space/SubSpace.swift new file mode 100644 index 0000000000..d17aa4155f --- /dev/null +++ b/Tests/SwiftOnly/Sub Space/SubSpace.swift @@ -0,0 +1 @@ +public func space() { print("space") }