From 06b3ad258338caacec9f75b9a6535610f717e17f Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 7 Oct 2024 11:04:05 +0300 Subject: [PATCH] CMakeLists.txt: add -rpath to look for libtownengine.so relative to executable --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11f0994..3379da6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,12 +172,15 @@ function(give_options_without_warnings target) target_compile_options(${target} PUBLIC ${BUILD_FLAGS} $<$:${BUILD_FLAGS_RELEASE}> - $<$:${BUILD_FLAGS_DEBUG}>) + $<$:${BUILD_FLAGS_DEBUG}> + $<$:-Wl,-rpath,./>) target_link_options(${target} PUBLIC ${BUILD_FLAGS} + # -Wl,--no-undefined # TODO: use later for implementing no-libc $<$:${BUILD_FLAGS_RELEASE}> - $<$:${BUILD_FLAGS_DEBUG}>) + $<$:${BUILD_FLAGS_DEBUG}> + $<$:-Wl,-rpath,./>) target_compile_definitions(${target} PUBLIC ORGANIZATION_NAME="${ORGANIZATION_NAME}"