aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-06-20 15:45:59 +1000
committerfuzzard <fuzzard@kodi.tv>2023-10-26 14:04:37 +1000
commit6e03d3f85172300118f86aa3b38850e7881f5cfc (patch)
tree8e9ad481e3888c96e110f085d4960ba34c5d49b0 /cmake
parenta22b85084ade03ba1b6b822724c09f62c02e8a83 (diff)
[cmake] module helper allow override of byproduct extension
Allows a lib to override the extension of a byproduct. This is used for example by macos when a shared lib is used. The extension in this case is dylib, but on other unix platforms its so
Diffstat (limited to 'cmake')
-rw-r--r--cmake/scripts/common/ModuleHelpers.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake
index 7bd5847974..7f3bdc7aee 100644
--- a/cmake/scripts/common/ModuleHelpers.cmake
+++ b/cmake/scripts/common/ModuleHelpers.cmake
@@ -326,6 +326,14 @@ macro(BUILD_DEP_TARGET)
set(BUILD_IN_SOURCE BUILD_IN_SOURCE ${BUILD_IN_SOURCE})
endif()
+ # Change extension of BYPRODUCT
+ # eg, Macos uses dylib for shared libs, but all other unix platforms use .so
+ if(${MODULE}_BYPRODUCT_EXTENSION)
+ string(REGEX REPLACE "\\.[^.]*$" "" _LIBNAME ${${MODULE}_BYPRODUCT})
+ set(${MODULE}_BYPRODUCT "${_LIBNAME}.${${MODULE}_BYPRODUCT_EXTENSION}")
+ unset(_LIBNAME)
+ endif()
+
# Set Library names.
if(DEFINED ${MODULE}_DEBUG_POSTFIX)
set(_POSTFIX ${${MODULE}_DEBUG_POSTFIX})