mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
Merge topic 'msvc-custom-rc-mt'
bd9bfc6449MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}0033676796CUDA: Enable RC language on Windows02f566a559MSVC: Factor out enable_language(RC) call into helper macrob601bb6f1cCUDA: Find CMAKE_LINKER on Windows3eebe28ef4cmLocalNinjaGenerator: Simplify CreateRulePlaceholderExpander Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2424
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user