Replies: 1 comment
-
Is a string replacement function that results in the string The actual output you want here is You can use I confess I'm surprised by this sqlite2cpp interface. Usually if a tool wants to choose the output filename itself it takes a directory argument, rather than taking the full path to the output filename but then appending the .h suffix on its own. If it doesn't want to choose the output filename, it just takes whatever you tell it. |
Beta Was this translation helpful? Give feedback.
-
I have the following snippet in my meson.build:
Given the
output = schema
, the programsqlite2cpp
will generate a file namedschema.h
(i.e. will add the extension). Problem: every time, I runmeson compile
, the custom target is re-run, and the fileschema.h
regenerated. My theory is that this is because the value ofoutput
does not match the name of the file that is actually generated.In order to prove my theory, I did the following instead:
Then I run
meson compile
, which generates a fileschema.h.h
; I manually rename this file to justschema.h
and recompile: the target is not re-run. I believe this is because theoutput
exactly matches the renamed generated file: from meson's perspective, there is nothing to do since theoutput
is up-to-date.So I wanted to go one step further:
My intent was to tell meson that the output would be named
schema.h
, and havesqlite2cpp
use the parameterschema
so that it actually generatesschema.h
, matching the output. But it seems thestrip()
call does nothing: the command that is executed is:so
schema.h
is passed on the command line. I tried to usereplace()
instead, to use@OUTPUT0
, to no avail.What's the trick? how can I achieve what I want, i.e. generate this
schema.h
once?Beta Was this translation helpful? Give feedback.
All reactions