summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-08-27 11:44:53 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-08-27 13:16:50 (GMT)
commit112c87b28afac71617bcbb552ae1f2027bb548b6 (patch)
tree7b0f053a343bffcd5a0beb98ef8b6fb43545696c
parentcd351ef2c427284eea0ab494eba5d4f24bc0e050 (diff)
downloadCMake-112c87b28afac71617bcbb552ae1f2027bb548b6.zip
CMake-112c87b28afac71617bcbb552ae1f2027bb548b6.tar.gz
CMake-112c87b28afac71617bcbb552ae1f2027bb548b6.tar.bz2
Makefiles: Replace method with Wacom specific API
The existing method uses RelativeRoot NONE and FULL values. In principle, those should be segregated interfaces. Mixing NONE and FULL into the RelativeRoot enum is a case of http://thedailywtf.com/articles/What_Is_Truth_0x3f_
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx22
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h3
2 files changed, 17 insertions, 8 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f2ef5c8..f026b12 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -592,8 +592,8 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
}
}
-std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand(
- std::string const& cmd, cmOutputConverter::RelativeRoot root)
+std::string cmLocalUnixMakefileGenerator3::MaybeConvertWatcomShellCommand(
+ std::string const& cmd)
{
if (this->IsWatcomWMake() && cmSystemTools::FileIsFullPath(cmd.c_str()) &&
cmd.find_first_of("( )") != cmd.npos) {
@@ -606,7 +606,7 @@ std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand(
cmOutputConverter::SHELL);
}
}
- return this->Convert(cmd, root, cmOutputConverter::SHELL);
+ return std::string();
}
void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
@@ -638,8 +638,13 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
#endif
}
- std::string cmakeShellCommand = this->ConvertShellCommand(
- cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL);
+ std::string cmakeShellCommand =
+ this->MaybeConvertWatcomShellCommand(cmSystemTools::GetCMakeCommand());
+ if (cmakeShellCommand.empty()) {
+ cmakeShellCommand =
+ this->Convert(cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL,
+ cmOutputConverter::SHELL);
+ }
/* clang-format off */
makefileStream
@@ -975,7 +980,12 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string launcher = this->MakeLauncher(
ccg, target, workingDir.empty() ? cmOutputConverter::START_OUTPUT
: cmOutputConverter::NONE);
- cmd = launcher + this->ConvertShellCommand(cmd, cmOutputConverter::NONE);
+ std::string shellCommand = this->MaybeConvertWatcomShellCommand(cmd);
+ if (shellCommand.empty()) {
+ shellCommand = this->Convert(cmd, cmOutputConverter::NONE,
+ cmOutputConverter::SHELL);
+ }
+ cmd = launcher + shellCommand;
ccg.AppendArguments(c, cmd);
if (content) {
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 243cc3d..ea98607 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -250,8 +250,7 @@ protected:
void CheckMultipleOutputs(bool verbose);
private:
- std::string ConvertShellCommand(std::string const& cmd,
- cmOutputConverter::RelativeRoot root);
+ std::string MaybeConvertWatcomShellCommand(std::string const& cmd);
std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
cmGeneratorTarget* target,
cmOutputConverter::RelativeRoot relative);