Skip to content

Commit 455f4b6

Browse files
committed
build: update meson build_rpath for darwin builds
Add a new rpath to the executable via the existing `build_rpath` property which we use in the Linux builds to resolve the `FMod` library at runtime. The `@executable_path` resolver is used to generate a path relative to the compiled executable in the `build/` directory.
1 parent 1c55602 commit 455f4b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ if compiler.get_argument_syntax()== 'gcc' # used for gcc compatible compilers
3434
message('gcc detected')
3535

3636
build_rpath = '$ORIGIN:$ORIGIN/../external/lib/linux/x86_64' # Set RUNPATH so that CCCP can find libfmod.so without needing to set LD_LIBRARY_PATH
37+
38+
if host_machine.system()=='darwin'
39+
build_rpath = '@executable_path/../external/lib/macos' # Add a new R_PATH CCCP can find libfmod.dylib on Darwin TODO: Confirm and validate this.
40+
endif
41+
3742
#suffix = 'x86_64'
3843
if host_machine.system()=='linux'
3944
link_args += ['-Wl,--enable-new-dtags'] # Set RUNPATH instead of RPATH

0 commit comments

Comments
 (0)