From 1a281a1acdcce3d6ce5a2a37fc4e0f6ab77ff0c3 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Thu, 21 Feb 2019 20:00:38 +0100 Subject: RC: Pass output file in a way that llvm-rc 7 and below understand Prior to LLVM 8.0, `llvm-rc` does not recognize `/fo` without a space after it. Add the space unconditionally because MS `rc` accepts it too. Issue: #18957 --- Modules/CMakeRCInformation.cmake | 2 +- Source/cmcldeps.cxx | 2 +- Source/cmcmd.cxx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 1227fdf..7bf6567 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -32,7 +32,7 @@ set(CMAKE_INCLUDE_FLAG_RC "-I") # compile a Resource file into an object file if(NOT CMAKE_RC_COMPILE_OBJECT) set(CMAKE_RC_COMPILE_OBJECT - " /fo ") + " /fo ") endif() # set this variable so we can avoid loading this more than once. diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx index 1a10666..19d0d38 100644 --- a/Source/cmcldeps.cxx +++ b/Source/cmcldeps.cxx @@ -276,7 +276,7 @@ int main() std::string clrest = rest; // rc: /fo x.dir\x.rc.res -> cl: /out:x.dir\x.rc.res.dep.obj - clrest = replace(clrest, "/fo", "/out:"); + clrest = replace(clrest, "/fo ", "/out:"); clrest = replace(clrest, objfile, objfile + ".dep.obj "); cl = "\"" + cl + "\" /P /DRC_INVOKED /TC "; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index adfce37..28f5e08 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1830,7 +1830,8 @@ int cmVSLink::LinkIncremental() // Compile the resource file. std::vector rcCommand; rcCommand.push_back(this->RcPath.empty() ? "rc" : this->RcPath); - rcCommand.push_back("/fo" + this->ManifestFileRes); + rcCommand.emplace_back("/fo"); + rcCommand.push_back(this->ManifestFileRes); rcCommand.push_back(this->ManifestFileRC); if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) { return -1; -- cgit v0.12