diff --git a/examples/build_with_meson/meson.build b/examples/build_with_meson/meson.build index 20012baa..294c84c4 100644 --- a/examples/build_with_meson/meson.build +++ b/examples/build_with_meson/meson.build @@ -7,7 +7,7 @@ project( # find dependencies # - it's good practice to specifiy minimum version requirements; here we just assume that `iguana` already did this -hipo_dep = dependency('hipo4', static: true) # use static link, for performance +hipo_dep = dependency('hipo4') iguana_dep = dependency('iguana') # set rpath @@ -15,8 +15,11 @@ iguana_dep = dependency('iguana') # - alternatively, set $LD_LIBRARY_PATH before running your executables ($DYLD_LIBRARY_PATH on macOS) # - not needed for libraries which are static-linked bin_rpaths = [ - iguana_dep.get_variable(pkgconfig: 'libdir') + hipo_dep.get_variable(pkgconfig: 'libdir') ] +if host_machine.system() != 'darwin' + bin_rpaths += iguana_dep.get_variable(pkgconfig: 'libdir') # not needed on macOS +endif # build and install the executable example_bin = 'iguana-example-00-basic' diff --git a/meson.build b/meson.build index 61c5ea0f..5e1db3f7 100644 --- a/meson.build +++ b/meson.build @@ -35,7 +35,6 @@ yamlcpp_dep = dependency( ) hipo_dep = dependency( 'hipo4', - static: true, method: 'pkg-config', version: '>=4.0.1', ) @@ -148,7 +147,9 @@ project_test_env.set( ) # executables' rpath -project_exe_rpath = [] +project_exe_rpath = [ + hipo_dep.get_variable(pkgconfig: 'libdir') +] if host_machine.system() != 'darwin' # FIXME(darwin): not sure how to set multiple rpaths on darwin executables, # aside from running `install_name_tool -add_rpath` post-installation;