Module: kamailio
Branch: master
Commit: c49bc39e62af94588fe3c0d44c9e781a498fb78a
URL:
https://github.com/kamailio/kamailio/commit/c49bc39e62af94588fe3c0d44c9e781…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Xenofon Karamanos <xk(a)gilawa.com>
Date: 2024-12-19T17:47:51Z
cmake: Add -ffile-prefix for core and all modules
---
Modified: src/CMakeLists.txt
Modified: src/modules/CMakeLists.txt
---
Diff:
https://github.com/kamailio/kamailio/commit/c49bc39e62af94588fe3c0d44c9e781…
Patch:
https://github.com/kamailio/kamailio/commit/c49bc39e62af94588fe3c0d44c9e781…
---
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d7456984d94..0faa97fffad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -90,6 +90,9 @@ set_target_properties(
kamailio PROPERTIES ENABLE_EXPORTS TRUE OUTPUT_NAME ${MAIN_NAME}
)
+target_compile_options(kamailio
+ PUBLIC "-ffile-prefix-map=${CMAKE_SOURCE_DIR}/src/=")
+
add_subdirectory(core)
add_subdirectory(lib)
add_subdirectory(modules)
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
index a301f63ed11..fe13a88f537 100644
--- a/src/modules/CMakeLists.txt
+++ b/src/modules/CMakeLists.txt
@@ -75,6 +75,13 @@ function(add_module_group group_modules)
target_compile_definitions(
${module_name} PRIVATE MOD_NAMEID=${module_name}
MOD_NAME=\"${module_name}\")
+
+ target_compile_options(
+ ${module_name}
+ PRIVATE
+
"-ffile-prefix-map=${CMAKE_SOURCE_DIR}/src/modules/${module_name}/="
+ )
+
set_target_properties(
${module_name} PROPERTIES INSTALL_RPATH
"${CMAKE_INSTALL_FULL_LIBDIR}/${MAIN_NAME}")