From 0c96fbd5d0e037f1a611cf8f049ff3c262853e94 Mon Sep 17 00:00:00 2001 From: penmetsaa Date: Tue, 19 Jul 2022 13:42:03 +0530 Subject: [PATCH] Fixating the absl-cpp version that we download and cpp readme update after #2791 (#2793) * Readme update w.r.t new abseil-cpp dependency and fixing the absl-cpp version that we download. * Reducing hash of commit to just working level --- cpp/README | 24 ++++++++++++++++++++++++ tools/cpp/CMakeLists.txt | 5 +++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cpp/README b/cpp/README index 5e756a161..4ddf0bd02 100644 --- a/cpp/README +++ b/cpp/README @@ -135,6 +135,30 @@ Requirements: Note: Boost Thread is the only library needed at link time. + - abseil-cpp + As this dependency package might not be very common, we are downloading, + building and linking this library as part of the regular build process i.e + part of CMake/Make instructions. If you wish to install this C++ developer + library at your system level and avoid building every time, you can try + below instruction set. + + Installation: + - Official [installation guide](https://abseil.io/docs/cpp/tools/cmake-installs). + Something that we followed in Linux system. + $ git clone https://github.com/abseil/abseil-cpp.git --branch 273292d --single-branch + $ cd abseil-cpp + $ cmake . -DCMAKE_INSTALL_PREFIX="$HOME/lpn-deps" -DCMAKE_POSITION_INDEPENDENT_CODE=ON + $ cmake --build . --target install + - When building libphonenumber library, if abseil-cpp is still getting downloaded and + built, use flags like ```CMAKE_PREFIX_PATH="$HOME/lpn-deps"``` + - Notes: + - We are cloning only a particular version of the abseil-cpp so that we + are not commiting to catch up with new build requirements of that + library. Eg: After the above tag version C++14 is made as minimum + version to build abseil-cpp library. + - libphonenumber is presently using C++11 by default, you can always + change it by passing ```CMAKE_CXX_STANDARD``` flag. + Building and testing the library -------------------------------- $ cd libphonenumber/cpp diff --git a/tools/cpp/CMakeLists.txt b/tools/cpp/CMakeLists.txt index a12a9af3b..e7ef92d1c 100644 --- a/tools/cpp/CMakeLists.txt +++ b/tools/cpp/CMakeLists.txt @@ -29,11 +29,12 @@ include (gtest.cmake) include (FetchContent) if(NOT absl_FOUND) - # Downloading the abseil sources. + # 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( abseil-cpp GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git - GIT_TAG origin/master + GIT_TAG 273292d ) # Building the abseil binaries