https://github.com/audacity/audacity/commit/6edaa3f26b34adc65c109c1a5a85923e04330e2d https://github.com/audacity/audacity/pull/4918 From 6edaa3f26b34adc65c109c1a5a85923e04330e2d Mon Sep 17 00:00:00 2001 From: Dmitry Vedenko Date: Mon, 7 Aug 2023 17:12:49 +0300 Subject: [PATCH] Fixes RapidJSON missing from Linux builds --- .../cmake-modules/dependencies/rapidjson.cmake | 15 +++++++++++++-- linux/packages/arch/dependencies.sh | 1 + linux/packages/fedora34/dependencies.sh | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cmake-proxies/cmake-modules/dependencies/rapidjson.cmake b/cmake-proxies/cmake-modules/dependencies/rapidjson.cmake index c44aad81b8e4..ba95962a6eb6 100644 --- a/cmake-proxies/cmake-modules/dependencies/rapidjson.cmake +++ b/cmake-proxies/cmake-modules/dependencies/rapidjson.cmake @@ -1,7 +1,18 @@ # CCI pakage appears to set the wrong value for the `cmake_target_name` -if(${_OPT}use_rapidjson STREQUAL "local") +if(NOT ${_OPT}use_rapidjson STREQUAL "off") if(NOT TARGET rapidjson::rapidjson) - add_library( rapidjson::rapidjson ALIAS rapidjson ) + if(TARGET rapidjson) + add_library( rapidjson::rapidjson ALIAS rapidjson ) + else() + # At least on Arch RapidJSONConfig.cmake does not define a target at all + # so we have to do it ourselves + add_library( rapidjson::rapidjson INTERFACE IMPORTED GLOBAL) + if (RAPIDJSON_INCLUDE_DIRS ) + target_include_directories( rapidjson::rapidjson INTERFACE ${RAPIDJSON_INCLUDE_DIRS} ) + elseif(RapidJSON_INCLUDE_DIR) + target_include_directories( rapidjson::rapidjson INTERFACE ${RapidJSON_INCLUDE_DIR} ) + endif() + endif() endif() endif() diff --git a/linux/packages/arch/dependencies.sh b/linux/packages/arch/dependencies.sh index d34012442efd..8aa8792057d4 100755 --- a/linux/packages/arch/dependencies.sh +++ b/linux/packages/arch/dependencies.sh @@ -44,6 +44,7 @@ deps=( wavpack wxwidgets-gtk3 vst3sdk + rapidjson ) pacman -Syu --noconfirm \ diff --git a/linux/packages/fedora34/dependencies.sh b/linux/packages/fedora34/dependencies.sh index 8f6ce8ff2eb8..1e039612b095 100755 --- a/linux/packages/fedora34/dependencies.sh +++ b/linux/packages/fedora34/dependencies.sh @@ -54,6 +54,7 @@ deps=( mesa-libEGL-devel mpg123-devel wavpack-devel + rapidjson ) dnf install -y \