Set rpath on cxx-generate-packed-data so we don't need to set LD_LIBRARY_PATH

This commit sets the 'build_rpath' argument on the
cxx-generate-packed-data executable to the protobuf library's libdir,
which supports the use case where the protobuf library is installed into
a non-default path. For instance, in the CI environment protobuf is
installed into a subdirectory of $HOME, which is not searched by the
runtime linker.

This approach was recommended on the mesonbuild mailing list.
This commit is contained in:
Robert Edmonds 2018-09-04 00:56:48 -04:00
parent 01973fb2fb
commit 0c3c6d8f9a
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,6 @@ env:
global:
- PROTOBUF_VERSION=3.6.1
- PKG_CONFIG_PATH=$HOME/protobuf-$PROTOBUF_VERSION-bin/lib/pkgconfig
- LD_LIBRARY_PATH=$HOME/protobuf-$PROTOBUF_VERSION-bin/lib
install:
- pip3 install meson

View File

@ -199,7 +199,8 @@ if get_option('build-compiler') and get_option('run-tests')
executable('cxx-generate-packed-data', 't/generated-code2/cxx-generate-packed-data.cc',
gen_protobuf.process('t/test-full.proto',
preserve_path_from : meson.current_source_dir()),
dependencies : protobuf),
dependencies : protobuf,
build_rpath : protobuf.get_pkgconfig_variable('libdir')),
capture : true)
test('generated-code2',