File 0001-Fix-geocoding-build-when-static-libraries-are-off.patch of Package libphonenumber-nemo

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index d2d111d5..39d04f79 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -468,7 +468,9 @@ if (BUILD_STATIC_LIB)
 
   if (BUILD_GEOCODER)
     add_library (geocoding STATIC ${GEOCODING_SOURCES})
-    target_link_libraries (geocoding ${LIBRARY_DEPS})
+    if (${BUILD_STATIC_LIB} STREQUAL "ON")
+        target_link_libraries (geocoding ${LIBRARY_DEPS})
+    endif ()
     target_include_directories(geocoding PUBLIC $<INSTALL_INTERFACE:include>)
     add_dependencies (geocoding generate_geocoding_data)
     add_dependencies (phonenumber generate_geocoding_data)
@@ -599,7 +601,11 @@ if(BUILD_TESTING)
   # libraries are built properly.
   if (BUILD_GEOCODER)
     add_executable (geocoding_test_program "test/phonenumbers/geocoding/geocoding_test_program.cc")
-    target_link_libraries (geocoding_test_program geocoding phonenumber)
+    if (${BUILD_STATIC_LIB} STREQUAL "ON")
+        target_link_libraries (geocoding_test_program geocoding phonenumber)
+    else ()
+        target_link_libraries (geocoding_test_program geocoding-shared phonenumber-shared)
+    endif ()
   endif ()
 endif()
 
openSUSE Build Service is sponsored by