Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [alpine-3.17, ubuntu-20.04, ubuntu-22.04]
os: [alpine-3.17, alpine-3.21, ubuntu-20.04, ubuntu-22.04]
platform: [linux/amd64]
include:
- os: alpine-3.17
platform: linux/arm64
- os: alpine-3.21
platform: linux/arm64
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
11 changes: 11 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ alpine-3.17:
rm -rf /var/cache/apk/*
RUN apk add openjdk8-jre

alpine-3.21:
FROM --platform=$BUILDPLATFORM alpine:3.21
RUN apk add --no-progress --update git build-base zip
RUN apk --no-cache --update add libgcc libstdc++ \
git make g++ \
build-base gtest gtest-dev boost boost-dev protobuf protobuf-dev cmake icu icu-dev openssl \
&& \
rm -rf /var/cache/apk/*
RUN apk add openjdk8-jre

ubuntu-20.04:
FROM --platform=$BUILDPLATFORM ubuntu:20.04
RUN apt-get update && apt-get -y upgrade
Expand Down Expand Up @@ -51,6 +61,7 @@ libphonenumber:
RUN make install

WORKDIR assets
RUN rm -rf lib/cmake
RUN zip -r ../libphonenumber_${TARGETARCH}-${buildos}.zip *

SAVE ARTIFACT /libphonenumber/cpp/build/libphonenumber_${TARGETARCH}-${buildos}.zip AS LOCAL cpp/build/libphonenumber_${TARGETARCH}-${buildos}.zip
Expand Down
12 changes: 9 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ endif ()
# Find all the required libraries and programs.
find_package(absl)

set (ABSL_LIB absl::node_hash_set absl::strings absl::synchronization)

if(NOT absl_FOUND)
# Overide abseil install rules for subprojects
set(ABSL_ENABLE_INSTALL ON)

# Downloading the abseil sources at particular version to not catch up
# with its new build requirements like min C++14 is mandated in that lib.
FetchContent_Declare(
Expand All @@ -128,7 +130,11 @@ if(NOT absl_FOUND)
# https://github.com/abseil/abseil-cpp/issues/225
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
add_subdirectory(${abseil-cpp_SOURCE_DIR} ${abseil-cpp_BINARY_DIR})
endif()
else ()
# Alpine 3.21, absl installed by default,
# protobuf generated with ABSL_DCHECK macros, so we need 'absl_check' deps
list (APPEND ABSL_LIB absl::absl_check)
endif ()

if (BUILD_TESTING)
include (../tools/cpp/gtest.cmake)
Expand Down Expand Up @@ -427,7 +433,7 @@ include_directories ("src")
# Collate dependencies
#----------------------------------------------------------------

set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} absl::node_hash_set absl::strings absl::synchronization)
set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} ${ABSL_LIB})

if (USE_BOOST)
list (APPEND LIBRARY_DEPS ${Boost_LIBRARIES})
Expand Down
Loading