gnuradio / pmt

pmt
GNU Lesser General Public License v3.0
11 stars 11 forks source link

meson: Make `pmtf_dep` depend on `pmt_gen_h_dep` #66

Closed ryanvolz closed 1 year ago

ryanvolz commented 1 year ago

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 on pmtf_dep which links with pmtf_lib which depends on pmt_gen_h_dep. Even though pmtf_lib depends on pmt_gen_h_dep, meson can't infer that the dependency pmtf_dep requires pmt_gen_h_dep since it could be a private header for pmtf_lib. Thus it could try to compile test_pmtf.cpp before compiling pmtf_lib and linking the two, and without knowing the dependency it could compile test_pmtf.cpp before even generating pmt_gen_h.

Adding a pmt_gen_h_dep dependency to pmtf_dep communicates that it is indeed a public header and that the build system will need to create it before building anything depending on pmtf_dep.

ryanvolz commented 1 year 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!