From d97ad4604af7998541567ec486f90dd528e839b1 Mon Sep 17 00:00:00 2001
From: Bernd Waibel <waebbl@gmail.com>
Date: Wed, 8 Apr 2020 19:09:42 +0200
Subject: [PATCH 1/4] [Gentoo-specific] avoid pre-stripping library

Signed-off-by: Bernd Waibel <waebbl@gmail.com>
---
 CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5453440..c867224 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,7 +104,8 @@ if (UNIX OR MINGW)
 	# Uncomment the following to but the version info into the .so-file.
 	SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
 	SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}")
-	if (NOT APPLE)
+	# avoid pre-stripping on Gentoo, this is done by emerge
+	if (NOT APPLE OR (UNIX AND NOT CMAKE_BUILD_TYPE MATCHES "Gentoo"))
 		SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES LINK_FLAGS -s)
 	endif()
 	if (NOT WIN32)
-- 
2.26.0

