Merge topic 'msvc-custom-rc-mt'

bd9bfc6449 MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}
0033676796 CUDA: Enable RC language on Windows
02f566a559 MSVC: Factor out enable_language(RC) call into helper macro
b601bb6f1c CUDA: Find CMAKE_LINKER on Windows
3eebe28ef4 cmLocalNinjaGenerator: Simplify CreateRulePlaceholderExpander

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2424
This commit is contained in:
Brad King
2018-11-02 11:56:57 +00:00
committed by Kitware Robot
10 changed files with 66 additions and 25 deletions
+1
View File
@@ -65,6 +65,7 @@ static const char* ruleReplaceVars[] = {
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
"CMAKE_LINKER",
"CMAKE_MT",
"CMAKE_CUDA_HOST_COMPILER",
"CMAKE_CUDA_HOST_LINK_LAUNCHER",
"CMAKE_CL_SHOWINCLUDES_PREFIX"
+2 -2
View File
@@ -17,6 +17,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmGlobalNinjaGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmNinjaTargetGenerator.h"
#include "cmRulePlaceholderExpander.h"
@@ -40,8 +41,7 @@ cmRulePlaceholderExpander*
cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const
{
cmRulePlaceholderExpander* ret =
new cmRulePlaceholderExpander(this->Compilers, this->VariableMappings,
this->CompilerSysroot, this->LinkerSysroot);
this->cmLocalGenerator::CreateRulePlaceholderExpander();
ret->SetTargetImpLib("$TARGET_IMPLIB");
return ret;
}
+10 -2
View File
@@ -1521,6 +1521,8 @@ class cmVSLink
std::string ManifestFileRC;
std::string ManifestFileRes;
std::string TargetFile;
std::string MtPath;
std::string RcPath;
public:
cmVSLink(int type, bool verbose)
@@ -1664,6 +1666,12 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
} else if (cmHasLiteralPrefix(*arg, "--intdir=")) {
intDir = arg->substr(9);
++arg;
} else if (cmHasLiteralPrefix(*arg, "--rc=")) {
this->RcPath = arg->substr(5);
++arg;
} else if (cmHasLiteralPrefix(*arg, "--mt=")) {
this->MtPath = arg->substr(5);
++arg;
} else {
std::cerr << "unknown argument '" << *arg << "'\n";
return false;
@@ -1803,7 +1811,7 @@ int cmVSLink::LinkIncremental()
// Compile the resource file.
std::vector<std::string> rcCommand;
rcCommand.push_back("rc");
rcCommand.push_back(this->RcPath.empty() ? "rc" : this->RcPath);
rcCommand.push_back("/fo" + this->ManifestFileRes);
rcCommand.push_back(this->ManifestFileRC);
if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
@@ -1862,7 +1870,7 @@ int cmVSLink::LinkNonIncremental()
int cmVSLink::RunMT(std::string const& out, bool notify)
{
std::vector<std::string> mtCommand;
mtCommand.push_back("mt");
mtCommand.push_back(this->MtPath.empty() ? "mt" : this->MtPath);
mtCommand.push_back("/nologo");
mtCommand.push_back("/manifest");
if (this->LinkGeneratesManifest) {