summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-02 18:25:30 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-13 14:18:02 (GMT)
commitb2c14bc7749c21b8a994ce1d9f4e736f712481b9 (patch)
treef57dd0db191b09e773e0de91072d72a053ec639c /Source/cmcmd.cxx
parent946adadd404a160b708e96e668be9b84c949de69 (diff)
downloadCMake-b2c14bc7749c21b8a994ce1d9f4e736f712481b9.zip
CMake-b2c14bc7749c21b8a994ce1d9f4e736f712481b9.tar.gz
CMake-b2c14bc7749c21b8a994ce1d9f4e736f712481b9.tar.bz2
cmake -E: Add cmake_transform_depfile internal command
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 15d2fd1..0bdc6fa 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -19,6 +19,7 @@
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmTransformDepfile.h"
#include "cmUVProcessChain.h"
#include "cmUtils.hxx"
#include "cmVersion.h"
@@ -1426,6 +1427,23 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return cmcmd::WindowsCEEnvironment("9.0", args[2]);
}
#endif
+
+ // Internal depfile transformation
+ if (args[1] == "cmake_transform_depfile" && args.size() == 6) {
+ auto format = cmDepfileFormat::GccDepfile;
+ if (args[2] == "gccdepfile") {
+ format = cmDepfileFormat::GccDepfile;
+ } else if (args[2] == "vstlog") {
+ format = cmDepfileFormat::VsTlog;
+ } else {
+ return 1;
+ }
+ std::string prefix = args[3];
+ if (prefix == "./") {
+ prefix.clear();
+ }
+ return cmTransformDepfile(format, prefix, args[4], args[5]) ? 0 : 1;
+ }
}
::CMakeCommandUsage(args[0].c_str());