clang: Fixes to module support
1. -fmodules-embed-all-files is a cc1 flag, and should have been passed
to clang++ via -Xclang.
2. Don't require a .cc in the target to emit the module_deps variables
(this is to be able to compile a target that contains only a
.modulemap, e.g. the C++ std module).
3. Add {{module_deps_no_self}}, which is the same as {{module_deps}}
except that it excludes the flags to include the pcm for the current
target.
That is, for A depending on B, and both using modules, when building
for A, {{module_deps}} will reference both A.pcm and B.pcm, and so
can be used to build .cc files in A. By contrast,
{{module_deps_no_self}} for A will only reference B.pcm, and so can
be used to build A.pcm.
Bug: fuchsia:27276
Change-Id: I239d1c5cd4d5d167251801b1347b02e8d89caeee
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/9680
Reviewed-by: Brett Wilson <[email protected]>
Commit-Queue: Scott Graham <[email protected]>
diff --git a/docs/reference.md b/docs/reference.md
index 257f474..f8c2bd4 100644
--- a/docs/reference.md
+++ b/docs/reference.md
@@ -3718,6 +3718,13 @@
prefixed by "-I" (these work with Posix tools as well as Microsoft
ones).
+ {{module_deps}}
+ {{module_deps_no_self}}
+ Strings that correspond to the flags necessary to depend upon the Clang
+ modules referenced by the current target. The "_no_self" version doesn't
+ include the module for the current target, and can be used to compile
+ the pcm itself.
+
{{source}}
The relative path and name of the current input file.
Example: "../../base/my_file.cc"