diff --git a/contrib/src/libebur128/0001-CMake-Respect-the-BUILD_SHARED_LIBS-option-instead-o.patch b/contrib/src/libebur128/0001-CMake-Respect-the-BUILD_SHARED_LIBS-option-instead-o.patch new file mode 100644 index 0000000000000000000000000000000000000000..1b8410e397a54ef4c41be2e5b97f059573b6b1c0 --- /dev/null +++ b/contrib/src/libebur128/0001-CMake-Respect-the-BUILD_SHARED_LIBS-option-instead-o.patch @@ -0,0 +1,121 @@ +From 92f0606875e60885f7c9f7543b6c72731c87e525 Mon Sep 17 00:00:00 2001 +From: Marvin Scholz <epirat07@gmail.com> +Date: Wed, 30 Sep 2020 12:31:17 +0200 +Subject: [PATCH] CMake: Respect the BUILD_SHARED_LIBS option instead of + BUILD_STATIC_LIBS + +Instead of the custom BUILD_STATIC_LIBS option, properly respect the +BUILD_SHARED_LIBS option as documented by CMake at +https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html +--- + CMakeLists.txt | 9 +++++--- + ebur128/CMakeLists.txt | 52 +++++++++++++++++++++++------------------- + 2 files changed, 35 insertions(+), 26 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f741317..3901457 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,9 @@ + cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) + project(libebur128 C) + ++option(BUILD_SHARED_LIBS ++ "Build shared libraries instead of static ones" ON) ++ + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) + set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) +@@ -23,10 +26,10 @@ endif() + message(STATUS "Status found / disabled --") + message(STATUS "queue.h: ${SUMMARY_HAS_QUEUE}" " ${USE_QUEUE}") + +-if(BUILD_STATIC_LIBS) +- message(STATUS "build static library and shared library!") ++if(BUILD_SHARED_LIBS) ++ message(STATUS "Building shared library (set BUILD_SHARED_LIBS to NO to build static)") + else() +- message(STATUS "not building static library, set BUILD_STATIC_LIBS to ON to enable") ++ message(STATUS "Building static library") + endif() + + if(NOT ${SUMMARY_HAS_QUEUE} AND NOT ${ENABLE_INTERNAL_QUEUE_H}) +diff --git a/ebur128/CMakeLists.txt b/ebur128/CMakeLists.txt +index d77385e..0e7845c 100644 +--- a/ebur128/CMakeLists.txt ++++ b/ebur128/CMakeLists.txt +@@ -25,30 +25,37 @@ endif() + set(EBUR128_VERSION_MAJOR 1) + set(EBUR128_VERSION 1.2.4) + +-#### static +-if(BUILD_STATIC_LIBS) +- add_library(ebur128_static STATIC ebur128.c) +- if(NOT MSVC) +- set_property(TARGET ebur128_static PROPERTY OUTPUT_NAME ebur128) +- endif() +-endif() ++add_library(ebur128 ebur128.c) + +-if(WITH_STATIC_PIC) +- set_property(TARGET ebur128_static PROPERTY POSITION_INDEPENDENT_CODE ON) +-endif() ++if(NOT BUILD_SHARED_LIBS) ++ # Static build specific things ++ if(WITH_STATIC_PIC) ++ set_property(TARGET ebur128 PROPERTY POSITION_INDEPENDENT_CODE ON) + +-#### shared +-# set source file for library, which includes def file if using MSVC +-set(EBUR128_SHARED_SOURCE ebur128.c) +-if(MSVC) +- set(EBUR128_SHARED_SOURCE ${EBUR128_SHARED_SOURCE} ebur128.def) +-endif() ++ set_target_properties(ebur128 PROPERTIES ++ SOVERSION ${EBUR128_VERSION_MAJOR} ++ VERSION ${EBUR128_VERSION}) ++ endif() + +-add_library(ebur128 SHARED ${EBUR128_SHARED_SOURCE}) +-set_target_properties(ebur128 PROPERTIES ++else() ++ # Share build specific things ++ set_target_properties(ebur128 PROPERTIES + SOVERSION ${EBUR128_VERSION_MAJOR} + VERSION ${EBUR128_VERSION}) + ++ if(WIN32) ++ set_target_properties(ebur128 PROPERTIES ++ OUTPUT_NAME ebur128 ++ RUNTIME_OUTPUT_NAME ebur128-${EBUR128_VERSION_MAJOR} ++ ARCHIVE_OUTPUT_NAME ebur128) ++ endif(WIN32) ++ ++ if(MSVC) ++ target_sources(ebur128 PRIVATE ebur128.def) ++ endif() ++endif() ++ ++# Link with Math library if available + find_library(MATH_LIBRARY m) + if(MATH_LIBRARY) + target_link_libraries(ebur128 ${MATH_LIBRARY}) +@@ -57,11 +64,10 @@ endif() + set(EBUR128_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "") + + install(FILES ebur128.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +-if(BUILD_STATIC_LIBS) +- install(TARGETS ebur128 ebur128_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-else() +- install(TARGETS ebur128 DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-endif() ++install(TARGETS ebur128 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + #### pkg-config + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libebur128.pc.cmake +-- +2.24.3 (Apple Git-128) + diff --git a/contrib/src/libebur128/rules.mak b/contrib/src/libebur128/rules.mak index 75d6cd7269ee1ea19180f9a1cf5c99408771a8e5..c480bc8be43fe2b0f4519d6590ca5014fe159f87 100644 --- a/contrib/src/libebur128/rules.mak +++ b/contrib/src/libebur128/rules.mak @@ -16,6 +16,7 @@ $(TARBALLS)/libebur128-$(LIBEBUR128_VERSION).tar.gz: libebur128: libebur128-$(LIBEBUR128_VERSION).tar.gz .sum-libebur128 $(UNPACK) $(call pkg_static,"./ebur128/libebur128.pc.cmake") + $(APPLY) $(SRC)/libebur128/0001-CMake-Respect-the-BUILD_SHARED_LIBS-option-instead-o.patch $(MOVE) .libebur128: libebur128 toolchain.cmake