summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/custom-ninja-deptypes.rst5
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
2 files changed, 10 insertions, 0 deletions
diff --git a/Help/release/dev/custom-ninja-deptypes.rst b/Help/release/dev/custom-ninja-deptypes.rst
new file mode 100644
index 0000000..7750da8
--- /dev/null
+++ b/Help/release/dev/custom-ninja-deptypes.rst
@@ -0,0 +1,5 @@
+custom-ninja-deptypes
+---------------------
+
+* Add a `CMAKE_NINJA_DEPTYPE_<LANG>` variable so that compilers may set the
+ deptype for use in Ninja other than those CMake itself knows about.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4319f3c..8865b3d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -418,6 +418,11 @@ cmNinjaTargetGenerator
else
{
deptype = "gcc";
+ const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
+ if (langdeptype)
+ {
+ deptype = langdeptype;
+ }
depfile = "$DEP_FILE";
const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
std::string depfileFlags = mf->GetSafeDefinition(flagsName);