Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libphonenumber] Enable geocoding and fix its build. Contributes to J…
…B#50394
- Loading branch information
Timur Kristóf
committed
Dec 18, 2020
1 parent
6f32574
commit 84ab0a9
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
rpm/0001-Fix-geocoding-build-when-static-libraries-are-off.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From 2e0cb4dee43eaf5f4dc256b2c62ff0f9ad39a280 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Timur=20Krist=C3=B3f?= <timur.kristof@gmail.com> | ||
Date: Wed, 16 Dec 2020 19:45:36 +0100 | ||
Subject: [PATCH] Fix geocoding build when static libraries are off. | ||
|
||
--- | ||
cpp/CMakeLists.txt | 14 +++++++++++--- | ||
1 file changed, 11 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt | ||
index 696d888d..32005fe6 100644 | ||
--- a/cpp/CMakeLists.txt | ||
+++ b/cpp/CMakeLists.txt | ||
@@ -480,7 +480,9 @@ if (${BUILD_GEOCODER} STREQUAL "ON") | ||
list (APPEND GEOCODER_DEPS ${COMMON_DEPS}) | ||
# Note that the subset of base/ on which the geocoder relies is implemented | ||
# on top of Boost header-only libraries (e.g. scoped_ptr.hpp). | ||
- target_link_libraries (geocoding ${LIBRARY_DEPS}) | ||
+ if (${BUILD_STATIC_LIB} STREQUAL "ON") | ||
+ target_link_libraries (geocoding ${LIBRARY_DEPS}) | ||
+ endif () | ||
target_link_libraries (geocoding-shared ${LIBRARY_DEPS}) | ||
endif () | ||
|
||
@@ -647,7 +649,9 @@ if (BUILD_SHARED_LIB) | ||
endif () | ||
|
||
if (${BUILD_GEOCODER} STREQUAL "ON") | ||
- install (TARGETS geocoding LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR}) | ||
+ if (${BUILD_STATIC_LIB} STREQUAL "ON") | ||
+ install (TARGETS geocoding LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR}) | ||
+ endif () | ||
install (TARGETS geocoding-shared LIBRARY DESTINATION ${LIBDIR} ARCHIVE | ||
DESTINATION ${LIBDIR}) | ||
endif () | ||
@@ -659,7 +663,11 @@ if (${BUILD_GEOCODER} STREQUAL "ON") | ||
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 () | ||
|
||
# Build an RPM | ||
-- | ||
2.29.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters