From bc4975a86418949a7cdc48c0d7afa34624ef710c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 14 Mar 2024 15:23:24 +0100 Subject: Re-enable -rdynamic so that Lua modules can load Lua API from exe. This fixes debugging Lua plugins from ZeroBraneStudio on Linux. --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 131e26e33..873e0ccba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -193,6 +193,13 @@ SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES +# Enable "-rdynamic" on Linux, so that external Lua modules can import Lua API symbols from the main executable: +# ( https://stackoverflow.com/questions/24015025/resolving-symbols-in-shared-object-to-executable ) +if (NOT WIN32) + target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-rdynamic") +endif() + + MACRO(TO_NATIVE_PATH PATH OUT) FILE(TO_NATIVE_PATH "${PATH}" "${OUT}") IF(MINGW) -- cgit v1.2.3