summaryrefslogtreecommitdiff
path: root/games-util/chiaki-ng/files/chiaki-ng-1.10.0-use-shared-nanopb.patch
blob: b4bd29015e30363c1a0f1497cc4d3f026faf0d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Huang Rui <vowstar@gmail.com>
Date: Sat, 13 Dec 2025 12:28:22 +0800
Subject: [PATCH] Use shared nanopb library instead of static

Gentoo provides nanopb as a shared library by default. This patch
allows chiaki-ng to link against the shared version, falling back
to static if shared is not available.

Bug: https://bugs.gentoo.org/965824
---
 cmake/FindNanopb.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmake/FindNanopb.cmake b/cmake/FindNanopb.cmake
index 1234567..abcdefg 100644
--- a/cmake/FindNanopb.cmake
+++ b/cmake/FindNanopb.cmake
@@ -12,6 +12,10 @@ find_package_handle_standard_args(Nanopb

 if(Nanopb_FOUND)
 	if(NOT TARGET Nanopb::nanopb)
-		add_library(Nanopb::nanopb ALIAS nanopb::protobuf-nanopb-static)
+		if(TARGET nanopb::protobuf-nanopb)
+			add_library(Nanopb::nanopb ALIAS nanopb::protobuf-nanopb)
+		else()
+			add_library(Nanopb::nanopb ALIAS nanopb::protobuf-nanopb-static)
+		endif()
 	endif()
 endif()