You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a C/C++ library with a precompiled header. Some of the cpp sources of the lib depend on generated headers, but none of the headers (including the pch) do. Every time any header is re-generated, allcpp files are recompiled, even though most of them have clearly no direct or indirect dependency to the generated headers.
This does not happen when I don't use a precompiled header.
project('buggy', 'cpp')
# very simple generated headergenerated=custom_target(
'generated.h',
output: 'generated.h',
input: files('generated.h.in'),
command: ['cp', '@INPUT@', '@OUTPUT@']
)
# only bar.cpp depends on the generated headershared_library('blub',
sources: [files('main.cpp', 'foo.cpp', 'bar.cpp'), generated],
cpp_pch: 'inc/fwd.hpp')
Every time you change generated.h.in, all cpp files are recompiled. Removing the cpp_pch line fixes that, then only bar.cpp gets recompiled on header change.
Expected behavior
I'd expect only the cpp sources that depend on the newly generated header to be recompiled.
In my case (the generated headers being shaders compiled and transformed into cpp arrays) this is very annoying and prevents me from using precompiled headers (since I have to recompile the whole lib every time I change a shader).
system parameters
On Linux, GCC, native build, my target is a shared library. Might affect other systems/configs. python --version: 3.10.7 meson --version: 0.63.2 ninja --version: 1.11.1
The text was updated successfully, but these errors were encountered:
I'm building a C/C++ library with a precompiled header. Some of the
cpp
sources of the lib depend on generated headers, but none of the headers (including the pch) do. Every time any header is re-generated, allcpp
files are recompiled, even though most of them have clearly no direct or indirect dependency to the generated headers.This does not happen when I don't use a precompiled header.
To Reproduce
See a minimal repro here: https://github.com/nyorain/meson-bug-repro
Every time you change
generated.h.in
, all cpp files are recompiled. Removing thecpp_pch
line fixes that, then onlybar.cpp
gets recompiled on header change.Expected behavior
I'd expect only the
cpp
sources that depend on the newly generated header to be recompiled.In my case (the generated headers being shaders compiled and transformed into cpp arrays) this is very annoying and prevents me from using precompiled headers (since I have to recompile the whole lib every time I change a shader).
system parameters
On Linux, GCC, native build, my target is a shared library. Might affect other systems/configs.
python --version
: 3.10.7meson --version
: 0.63.2ninja --version
: 1.11.1The text was updated successfully, but these errors were encountered: