From 26a1af344c241542fd9d091eb6ef76c96f33c13c Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Tue, 20 Jun 2023 11:45:59 +0200 Subject: [PATCH] Fix rpath in examples --- build.sh | 1 - examples/atlas/build.sh | 2 ++ examples/canvas/build.sh | 2 ++ examples/image/build.sh | 2 ++ examples/perf_text/build.sh | 2 ++ examples/polygon/build.sh | 2 ++ examples/smooth_resize/build.sh | 2 ++ examples/surface_sharing/build.sh | 2 ++ examples/tiger/build.sh | 2 ++ examples/triangleGLES/build.sh | 2 ++ examples/triangleMetal/build.sh | 2 ++ examples/ui/build.sh | 2 ++ 12 files changed, 22 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 173da3f..8fca4ba 100755 --- a/build.sh +++ b/build.sh @@ -77,7 +77,6 @@ if [ $target = 'lib' ] ; then # add executable path to rpath. Client executable can still add its own rpaths if needed, e.g. @executable_path/libs/ etc. install_name_tool -id "@rpath/libmilepost.dylib" $BINDIR/libmilepost.dylib - install_name_tool -add_rpath "@executable_path" $BINDIR/libmilepost.dylib else # additional targets diff --git a/examples/atlas/build.sh b/examples/atlas/build.sh index 9b7b41b..ab2560b 100755 --- a/examples/atlas/build.sh +++ b/examples/atlas/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_atlas main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_atlas diff --git a/examples/canvas/build.sh b/examples/canvas/build.sh index c5b5c50..ee7e2ad 100755 --- a/examples/canvas/build.sh +++ b/examples/canvas/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_canvas main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_canvas diff --git a/examples/image/build.sh b/examples/image/build.sh index 1e71bf2..f298744 100755 --- a/examples/image/build.sh +++ b/examples/image/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_image main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_image diff --git a/examples/perf_text/build.sh b/examples/perf_text/build.sh index b4d58dc..3f176c1 100755 --- a/examples/perf_text/build.sh +++ b/examples/perf_text/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-O2 -mmacos-version-min=10.15.4" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/perf_text main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/perf_text diff --git a/examples/polygon/build.sh b/examples/polygon/build.sh index f9ccf43..2dc5185 100755 --- a/examples/polygon/build.sh +++ b/examples/polygon/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_polygon main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_polygon diff --git a/examples/smooth_resize/build.sh b/examples/smooth_resize/build.sh index f587549..6204822 100755 --- a/examples/smooth_resize/build.sh +++ b/examples/smooth_resize/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_smooth_resize main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_smooth_resize diff --git a/examples/surface_sharing/build.sh b/examples/surface_sharing/build.sh index efd3018..5e6e39a 100755 --- a/examples/surface_sharing/build.sh +++ b/examples/surface_sharing/build.sh @@ -10,3 +10,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_surface_sharing main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_surface_sharing diff --git a/examples/tiger/build.sh b/examples/tiger/build.sh index 86aa49c..99b54e1 100755 --- a/examples/tiger/build.sh +++ b/examples/tiger/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_tiger main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_tiger diff --git a/examples/triangleGLES/build.sh b/examples/triangleGLES/build.sh index 2eb9124..d22877d 100755 --- a/examples/triangleGLES/build.sh +++ b/examples/triangleGLES/build.sh @@ -10,3 +10,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_gles_triangle main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_gles_triangle diff --git a/examples/triangleMetal/build.sh b/examples/triangleMetal/build.sh index 4d25f90..72c8081 100755 --- a/examples/triangleMetal/build.sh +++ b/examples/triangleMetal/build.sh @@ -13,3 +13,5 @@ xcrun -sdk macosx metallib -o shader.metallib shader.air cp shader.metallib $BINDIR/triangle_shader.metallib clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_metal_triangle main.m + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_metal_triangle diff --git a/examples/ui/build.sh b/examples/ui/build.sh index df717e6..9d06d53 100755 --- a/examples/ui/build.sh +++ b/examples/ui/build.sh @@ -9,3 +9,5 @@ LIBS="-L$BINDIR -lmilepost" FLAGS="-mmacos-version-min=10.15.4 -DDEBUG -DLOG_COMPILE_DEBUG" clang -g $FLAGS $LIBS $INCLUDES -o $BINDIR/example_ui main.c + +install_name_tool -add_rpath "@executable_path" $BINDIR/example_ui