From 0697033ec271aa76ecb9aff89487b7a07f6b4a8c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 25 Dec 2025 18:24:30 +0100 Subject: Decorate sources as 'generated' to make sure they inject a dependency to their generators, and look for the sources in the build folder instead of the source folder. --- src/task_cc.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/task_cc.cc') diff --git a/src/task_cc.cc b/src/task_cc.cc index 9628455..f81023f 100644 --- a/src/task_cc.cc +++ b/src/task_cc.cc @@ -23,6 +23,10 @@ TaskCC::TaskCC(const ctor::build_configuration& config_, const ctor::settings& s , sourceDir(sourceDir_) , _source(source) { + if(source.source_type == ctor::source_type::generated) + { + sourceFile = std::filesystem::path(settings.builddir) / sourceFile; + } sourceFile /= source.file; std::filesystem::path base = sourceFile.parent_path(); @@ -252,6 +256,10 @@ int TaskCC::clean() std::vector TaskCC::depends() const { + if(_source.source_type == ctor::source_type::generated) + { + return {sourceFile.string()}; + } return {}; } -- cgit v1.2.3