mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
This commit is contained in:
@@ -32,7 +32,7 @@ set(CMAKE_INCLUDE_FLAG_RC "-I")
|
|||||||
# compile a Resource file into an object file
|
# compile a Resource file into an object file
|
||||||
if(NOT CMAKE_RC_COMPILE_OBJECT)
|
if(NOT CMAKE_RC_COMPILE_OBJECT)
|
||||||
set(CMAKE_RC_COMPILE_OBJECT
|
set(CMAKE_RC_COMPILE_OBJECT
|
||||||
"<CMAKE_RC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /fo<OBJECT> <SOURCE>")
|
"<CMAKE_RC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /fo <OBJECT> <SOURCE>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# set this variable so we can avoid loading this more than once.
|
# set this variable so we can avoid loading this more than once.
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ int main()
|
|||||||
|
|
||||||
std::string clrest = rest;
|
std::string clrest = rest;
|
||||||
// rc: /fo x.dir\x.rc.res -> cl: /out:x.dir\x.rc.res.dep.obj
|
// 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 ");
|
clrest = replace(clrest, objfile, objfile + ".dep.obj ");
|
||||||
|
|
||||||
cl = "\"" + cl + "\" /P /DRC_INVOKED /TC ";
|
cl = "\"" + cl + "\" /P /DRC_INVOKED /TC ";
|
||||||
|
|||||||
@@ -1830,7 +1830,8 @@ int cmVSLink::LinkIncremental()
|
|||||||
// Compile the resource file.
|
// Compile the resource file.
|
||||||
std::vector<std::string> rcCommand;
|
std::vector<std::string> rcCommand;
|
||||||
rcCommand.push_back(this->RcPath.empty() ? "rc" : this->RcPath);
|
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);
|
rcCommand.push_back(this->ManifestFileRC);
|
||||||
if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
|
if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user