summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2014-03-24 03:47:56 (GMT)
committerBen Boeckel <mathstuf@gmail.com>2014-03-24 03:54:13 (GMT)
commit9523d2a55c99fb0910531ae7160b099faeab6638 (patch)
tree690d2a9b3fe1a905573080a007da738f47cf7875
parent6f39a6ff321ca1682af684713c8ff93a21fe32ae (diff)
downloadCMake-9523d2a55c99fb0910531ae7160b099faeab6638.zip
CMake-9523d2a55c99fb0910531ae7160b099faeab6638.tar.gz
CMake-9523d2a55c99fb0910531ae7160b099faeab6638.tar.bz2
ninja: Add support for custom depfile formats
Not everything that isn't MSVC is GCC. I have support for LDC's depfile format on its way upstream[1], but its future is uncertain. CMake should at least support this for future depfile formats. [1]https://github.com/martine/ninja/pull/721
-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);