summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-07-18 16:05:58 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-07-26 16:25:42 (GMT)
commitd7f5064ff79380d03e11c7fed01b6e225ea78337 (patch)
tree4e4ed40a60a7dbd340052042bd231c8c970b2a6b
parentb5a6648c4b4973c4747aa6a325938ca1e7d977d0 (diff)
downloadCMake-d7f5064ff79380d03e11c7fed01b6e225ea78337.zip
CMake-d7f5064ff79380d03e11c7fed01b6e225ea78337.tar.gz
CMake-d7f5064ff79380d03e11c7fed01b6e225ea78337.tar.bz2
cmScanDepFormat: support P1689R5
This adds the `is-interface` key on provides fields.
-rw-r--r--Help/dev/experimental.rst4
-rw-r--r--Help/release/dev/p1689r5.rst6
-rw-r--r--Source/cmScanDepFormat.cxx15
-rw-r--r--Source/cmScanDepFormat.h5
4 files changed, 28 insertions, 2 deletions
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
index b8d681c..adfa36f 100644
--- a/Help/dev/experimental.rst
+++ b/Help/dev/experimental.rst
@@ -58,7 +58,7 @@ dependencies to the file specified by the ``<DYNDEP_FILE>`` placeholder. The
for scandep rules which use ``msvc``-style dependency reporting.
The module dependencies should be written in the format described
-by the `P1689r4`_ paper.
+by the `P1689r5`_ paper.
Compiler writers may try out their scanning functionality using
the `cxx-modules-sandbox`_ test project, modified to set variables
@@ -85,5 +85,5 @@ the GCC documentation, but the relevant section for the purposes of CMake is:
-- GCC module mapper documentation
.. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html
-.. _`P1689r4`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1689r4.html
+.. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html
.. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox
diff --git a/Help/release/dev/p1689r5.rst b/Help/release/dev/p1689r5.rst
new file mode 100644
index 0000000..a630dc4
--- /dev/null
+++ b/Help/release/dev/p1689r5.rst
@@ -0,0 +1,6 @@
+p1689r5
+-------
+
+* C++ module scanning now supports the latest revision, `P1689R5`_.
+
+.. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html
diff --git a/Source/cmScanDepFormat.cxx b/Source/cmScanDepFormat.cxx
index 82a374a..81ef3da 100644
--- a/Source/cmScanDepFormat.cxx
+++ b/Source/cmScanDepFormat.cxx
@@ -188,6 +188,19 @@ bool cmScanDepFormat_P1689_Parse(std::string const& arg_pp,
return false;
}
+ if (provide.isMember("is-interface")) {
+ Json::Value const& is_interface = provide["is-interface"];
+ if (!is_interface.isBool()) {
+ cmSystemTools::Error(
+ cmStrCat("-E cmake_ninja_dyndep failed to parse ", arg_pp,
+ ": is-interface is not a boolean"));
+ return false;
+ }
+ provide_info.IsInterface = is_interface.asBool();
+ } else {
+ provide_info.IsInterface = true;
+ }
+
info->Provides.push_back(provide_info);
}
}
@@ -308,6 +321,8 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
provide_obj["source-path"] = EncodeFilename(provide.SourcePath);
}
+ provide_obj["is-interface"] = provide.IsInterface;
+
provides.append(provide_obj);
}
diff --git a/Source/cmScanDepFormat.h b/Source/cmScanDepFormat.h
index dae28d9..dc55bf1 100644
--- a/Source/cmScanDepFormat.h
+++ b/Source/cmScanDepFormat.h
@@ -18,6 +18,11 @@ struct cmSourceReqInfo
std::string SourcePath;
std::string CompiledModulePath;
bool UseSourcePath = false;
+
+ // Provides-only fields.
+ bool IsInterface = true;
+
+ // Requires-only fields.
LookupMethod Method = LookupMethod::ByName;
};