hi all, Could anyone give me a simple demo for `action` as below ?Dependencies: target A(do some gcc-compiled) depends on Action B.
--
To unsubscribe from this group and stop receiving emails from it, send an email to gn-dev+un...@chromium.org.
For binary targets (source sets, executables, and libraries), the known file types will be compiled with the associated tools. Unknown file types and headers will be skipped. However, you should still list all C/C+ header files so GN knows about the existence of those files for the purposes of include checking.
Re-reading this, it does feel like a bug to me, or at least a user-hostile experience. It makes sense that GN doesn't try to compile a .h file, but at the same time, the GN user explicitly added a file to the "sources" section of a target, and GN silently dropped an explicit file dependency on the floor.It's definitely surprising behavior, even if it is documented. Additionally, the documentation isn't particularly clear on what "skipped" means; it's very easy to read it as "won't be compiled" and not "will be fully ignored for both build and dependency purposes".
On Tue, Apr 11, 2023 at 12:30 PM Charles Nicholson <charles....@gmail.com> wrote:Re-reading this, it does feel like a bug to me, or at least a user-hostile experience. It makes sense that GN doesn't try to compile a .h file, but at the same time, the GN user explicitly added a file to the "sources" section of a target, and GN silently dropped an explicit file dependency on the floor.It's definitely surprising behavior, even if it is documented. Additionally, the documentation isn't particularly clear on what "skipped" means; it's very easy to read it as "won't be compiled" and not "will be fully ignored for both build and dependency purposes".GN is expecting you to hook up your compiler's dependency tracking for files included by your source files to the Ninja build. This will automatically discover the transitive set of include files and will cause rebuilds as necessary.