Skip to content

Commit

Permalink
Fix linking errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nephros committed Dec 9, 2023
1 parent b588fb6 commit 4def864
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rpm/0003-cmake-absl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index b3ecc4f..7864618 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -203,7 +203,8 @@ add_custom_command (
)

if (${BUILD_GEOCODER} STREQUAL "ON")
- find_package(absl)
+ # Use "CONFIG" as there is no built-in cmake module for absl.
+ find_package(absl CONFIG REQUIRED)

# Geocoding data cpp file generation
set (TOOLS_DIR "${CMAKE_CURRENT_BINARY_DIR}/tools")
13 changes: 13 additions & 0 deletions rpm/0004-Update-absl-dependencies-in-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index b3ecc4f..a35c680 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -479,7 +479,7 @@ endif ()
# Safeguarding against any potential link errors as mentioned in
# https://github.com/abseil/abseil-cpp/issues/225
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-list (APPEND LIBRARY_DEPS absl::node_hash_set absl::strings absl::synchronization)
+list (APPEND LIBRARY_DEPS absl::node_hash_set absl::strings absl::synchronization absl::log_internal_message absl::log_internal_check_op)

if (APPLE)
list (APPEND COMMON_DEPS ${COREFOUNDATION_LIB} ${FOUNDATION_LIB})
4 changes: 4 additions & 0 deletions rpm/libphonenumber.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Source0: %{name}-%{version}.tar.gz
# https://github.com/google/libphonenumber/pull/2556
Patch1: 0001-Fix-geocoding-build-when-static-libraries-are-off.patch
Patch2: 0002-Ensure-build-reproducibility.patch
# "Backport" of https://github.com/google/libphonenumber/pull/3213
Patch3: 0003-cmake-absl.patch
# "Backport" of https://github.com/google/libphonenumber/pull/3215
Patch4: 0004-Update-absl-dependencies-in-CMakeLists.txt

BuildRequires: gcc-c++
BuildRequires: cmake
Expand Down

0 comments on commit 4def864

Please sign in to comment.