Commit 053868e1 authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'wip/engine-header-missing-build-failure' into 'master'

Fix occasional "geary-engine.h: No such file or directory" build errors

See merge request !68
parents 1d15de11 1dd36d84
Pipeline #44903 passed with stage
in 42 minutes and 52 seconds
......@@ -337,69 +337,62 @@ geary_engine_dependencies = [
sqlite
]
build_dir = meson.current_build_dir()
# Generate internal VAPI for unit testing. See Meson issue
# https://github.com/mesonbuild/meson/issues/1781 for official
# internal VAPI support.
geary_engine_vala_options = geary_vala_options
geary_engine_vala_options += [
# Nasty hack to make sure engine internal VAPI is generated. See
# Meson issue https://github.com/mesonbuild/meson/issues/1781 for
# official internal VAPI support. See Vala Bug 731322 about the
# specifics of the arguments used below to generate the internal
# VAPI. In particular, the header filenames must not contain any
# paths or else the internal vapi will use the public header, not
# the internal header. Of course these paths breaks the build, so we
# fix it up using cp below. The internal VAPI is correctly put in
# Meson's base working directory,
'--header=geary-engine.h',
'--internal-vapi=../geary-engine-internal.vapi',
'--internal-header=geary-engine-internal.h'
'--internal-header=@0@/geary-engine-internal.h'.format(build_dir),
'--internal-vapi=@0@/geary-engine-internal.vapi'.format(build_dir)
]
geary_engine_lib = static_library('geary-engine',
geary_engine_sources,
dependencies: geary_engine_dependencies,
link_with: sqlite3_unicodesn_lib,
include_directories: config_h_dir,
vala_args: geary_engine_vala_options,
c_args: geary_c_options,
)
geary_engine_dep = declare_dependency(
link_with: [
geary_engine_lib,
sqlite3_unicodesn_lib,
],
include_directories: include_directories('.'),
)
# Dummy target to fix the location of the public and internal headers,
# and tell Meson about the internal VAPI
geary_engine_internal_vapi = custom_target(
'geary-engine-internal-vapi',
input: geary_engine_sources,
# Dummy target to tell Meson about the internal VAPI given the
# workaround above, and fix the VAPI header to work around
# GNOME/vala#358
geary_engine_internal_header_fixup = custom_target(
'geary_engine_internal_header_fixup',
source: geary_engine_sources,
output: [
'geary-engine-internal.h',
'geary-engine-internal.vapi',
],
command: [
find_program('cp'),
'geary-engine.h',
'geary-engine-internal.h',
'@OUTDIR@',
find_program('sed'),
'-i',
's/geary-engine.h/geary-engine-internal.h/g',
'@OUTDIR@/geary-engine-internal.vapi',
],
depends: geary_engine_lib
)
geary_engine_dep = declare_dependency(
link_with: [
geary_engine_lib,
sqlite3_unicodesn_lib
],
include_directories: include_directories('.')
)
geary_engine_internal_dep = declare_dependency(
# Can't just include geary_engine_lib in link_with since that will
# pull in the public header and we get duplicate symbol errors.
link_args: [
'-L' + meson.build_root() + '/src/engine',
'-L' + build_dir,
'-lgeary-engine'
],
link_with: [
sqlite3_unicodesn_lib,
],
include_directories: include_directories('.'),
sources: [
geary_engine_internal_vapi
],
sources: geary_engine_internal_header_fixup
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment