Re: Bug#1014594: muse: FTBFS on riscv64
Hi,
> This patch introduces an embedded copy of CheckAtomic.cmake from the
> extra-cmake-modules package but such copies are against Debian policy.
Okay, good to know. I was following a solution I saw to the same problem, but that file was added directly in upstream in that case. I will know for next time not to do that in debian patches.
> Instead the package should build-depend on extra-cmake-modules and add
> the relevant changes to the cmake files to load the CheckAtomic
> functionality installed in the extra-cmake-modules package.
> The ECM documentation mentions how to load the modules.
Thank you for the information! I submitted an updated patch in the merge request with the addition of build-depends on extra-cmake-modules (also attaching the new debian patch here).
>> Great, thanks for fixing this. Have you submitted your patch upstream as
>> well?
>> I'm seeing a lot of people submitting patches to this mailing list and I
>> really hope these are all also submitted upstream so other distributions
>> can profit from these improvements as well.
Yes, I submitted the new patch upstream and I agree that we should always be doing that!
Ileana
From: Ileana Dumitrescu <ileanadumi95@protonmail.com>
Date: Tue, 12 Jul 2022 15:42:06 +0300
Subject: [PATCH] link with libatomic if needed
---
src/CMakeLists.txt | 4 ++++
src/muse/CMakeLists.txt | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1f861f7..b2ab466 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,6 +23,9 @@
project(muse)
+find_package(ECM REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+
include(FindPkgConfig)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
@@ -30,6 +33,7 @@ include(CheckIncludeFiles)
include (CheckCSourceCompiles)
include(cmake/Summary.cmake)
include(CheckCXXSymbolExists)
+include(CheckAtomic)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10.2)
if (COMMAND cmake_policy)
diff --git a/src/muse/CMakeLists.txt b/src/muse/CMakeLists.txt
index 52cdaeb..4d14967 100644
--- a/src/muse/CMakeLists.txt
+++ b/src/muse/CMakeLists.txt
@@ -355,7 +355,11 @@ if(LV2_SUPPORT)
PROPERTIES COMPILE_FLAGS "-Wno-error"
OUTPUT_NAME muse_lv2host_module
)
-
+
+ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+ target_link_libraries(lv2host_module atomic)
+ endif()
+
target_link_libraries(lv2host_module ${LILV_LIBRARIES})
target_link_libraries(lv2host_module ${SORD_LIBRARIES})
target_link_libraries(lv2host_module ${LV2_LIBRARIES})
--
2.35.2
Reply to: