Issue #4291: meson: pdbgen not working.

The build now successfully build the PDB files into the source folder
itself. Unfortunately it seems I can't get meson dependencies to work
properly, once more! I added a "sources" argument to the relevant
library() or static_library() but it still uses old versions to build
these. E.g. if I add an error on purpose to a pdb file, the next build
still passes, yet the second-next fails (as it should have before).

Note that I even tested a declare_dependency() with just the "sources"
arguments, because it says "sources to add to targets (or generated
header files that should be built before sources including them are
built)" (so I assume it means that it should be trigger a rebuild,
otherwise it's useless) but it's just not working. I'll investigate
more.

Still going with this for now, because at least generating the PDB
source was a big miss until now. But we should
This commit is contained in:
Jehan 2022-03-27 22:07:32 +02:00
parent 288a5f1c7e
commit 79615541d9
5 changed files with 38 additions and 14 deletions

View file

@ -80,4 +80,7 @@ libappinternalprocs = static_library('appinternalprocs',
dependencies: [
cairo, gegl, gdk_pixbuf,
],
sources: [
pdbgen
],
)

View file

@ -298,6 +298,9 @@ libgimp = library('gimp-'+ gimp_api_version,
drmingw,
gtk3,
],
sources: [
pdbgen
],
c_args: [ '-DG_LOG_DOMAIN="LibGimp"', '-DGIMP_COMPILATION', ],
link_with: [
libgimpbase,

View file

@ -1667,6 +1667,7 @@ endif
# Tools
subdir('libgimpbase')
subdir('tools')
subdir('pdb')
# Translations
subdir('po')
@ -1700,7 +1701,6 @@ subdir('extensions')
subdir('modules')
subdir('plug-ins')
subdir('app')
subdir('pdb')
subdir('app-tools')
# Docs

15
pdb/meson-pdbgen.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
PERL="$1"
top_srcdir="$2"
top_builddir="$3"
# Environment for the pdbgen.pl file.
destdir=`cd "$top_srcdir" && pwd`
export destdir
builddir=`cd "$top_builddir" && pwd`
export BUILD builddir
cd "$top_srcdir"/pdb
$PERL pdbgen.pl app lib
echo `date` > $top_builddir/pdb/stamp-pdbgen

View file

@ -63,11 +63,11 @@ endforeach
enum_headers = [
gimpbaseenums,
appconfigenums,
appoperationsenums,
appcoreenums,
apppaintenums,
meson.source_root() + '/libgimpbase/gimpbaseenums.h',
meson.source_root() + '/libgimpconfig/gimpconfigenums.h',
meson.source_root() + '/app/operations/operations-enums.h',
meson.source_root() + '/app/core/core-enums.h',
meson.source_root() + '/app/paint/paint-enums.h'
]
# Perl environment
@ -82,7 +82,7 @@ perl_env = [
'destdir=' + meson.build_root(),
'builddir=' + meson.build_root(),
]
perl= [
perl_opts = [
perl,
'-I', perlbindir,
'-I', perlsrcdir,
@ -106,6 +106,8 @@ groups_pl = custom_target('groups.pl',
capture: true,
)
pdbgen_run = find_program('meson-pdbgen.sh')
if meson.version().version_compare('>=0.57.0')
enums_pl = custom_target('enums.pl',
input : [ 'enumgen.pl', 'enums-external.pl', enum_headers, ],
@ -122,6 +124,7 @@ if meson.version().version_compare('>=0.57.0')
pdbgen = custom_target('stamp-pdbgen',
input : [
files(
'meson-pdbgen.sh',
'pdbgen.pl',
'app.pl',
@ -137,8 +140,7 @@ if meson.version().version_compare('>=0.57.0')
output: [ 'stamp-pdbgen', ],
env: perl_env,
command: [
perl, '@INPUT0@',
'app', 'lib',
pdbgen_run, perl, meson.source_root(), meson.build_root()
],
)
@ -147,7 +149,7 @@ if meson.version().version_compare('>=0.57.0')
output: [ 'stamp-enum-code', ],
env: perl_env,
command: [
perl, '@INPUT0@',
perl_opts, '@INPUT0@',
],
)
else
@ -160,7 +162,7 @@ else
input : [ 'enumgen.pl', 'enums-external.pl', enum_headers, ],
output: [ 'enums.pl', ],
command: [
env, perl_env, perl, '@INPUT0@',
env, perl_env, perl_opts, '@INPUT0@',
enum_headers,
],
)
@ -168,6 +170,7 @@ else
pdbgen = custom_target('stamp-pdbgen',
input : [
files(
'meson-pdbgen.sh',
'pdbgen.pl',
'app.pl',
@ -182,16 +185,16 @@ else
],
output: [ 'stamp-pdbgen', ],
command: [
env, perl_env, perl, '@INPUT0@',
'app', 'lib',
env, perl_env, pdbgen_run, perl, meson.source_root(), meson.build_root()
],
)
stamp_enumcode = custom_target('stamp-enum-code',
input : [ 'enumcode.pl', ],
output: [ 'stamp-enum-code', ],
command: [
env, perl_env, perl, '@INPUT0@',
env, perl_env, perl_opts, '@INPUT0@',
],
)
endif