Closed ryanvolz closed 2 years ago
I rebased this so it's on its own and ready to go!
This LGTM, it's more generally the caveat that is noted at https://mesonbuild.com/FAQ.html#how-do-i-tell-meson-that-my-sources-use-generated-headers
That's exactly what I read to make me figure out what was happening. Yay for docs!
This fixes an error found while attempting to cross-compile GNU Radio with pmt as a subproject for linux-aarch64 in https://github.com/gnuradio/gnuradio/pull/6212. It builds on #65 to enable that PR to test the build with these changes.
The fix is relevant for
test_pmtf.cpp
, which depends onpmtf_dep
which links withpmtf_lib
which depends onpmt_gen_h_dep
. Even thoughpmtf_lib
depends onpmt_gen_h_dep
, meson can't infer that the dependencypmtf_dep
requirespmt_gen_h_dep
since it could be a private header forpmtf_lib
. Thus it could try to compiletest_pmtf.cpp
before compilingpmtf_lib
and linking the two, and without knowing the dependency it could compiletest_pmtf.cpp
before even generatingpmt_gen_h
.Adding a
pmt_gen_h_dep
dependency topmtf_dep
communicates that it is indeed a public header and that the build system will need to create it before building anything depending onpmtf_dep
.