From 0da9243ba36ef914c25fca1185ebf0306a9ae9b9 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Wed, 27 Sep 2023 21:18:42 +0800 Subject: [PATCH] 3rd --- CMakeLists.txt | 2 +- run.sh | 2 +- thirdparty/CMakeLists.txt | 33 ++++++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fee1807892..12c87dadd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. -project(pegasus) cmake_minimum_required(VERSION 3.11.0) +project(pegasus) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # require at least gcc 7.0.0 diff --git a/run.sh b/run.sh index 2672094f7c..4926fd445a 100755 --- a/run.sh +++ b/run.sh @@ -227,7 +227,7 @@ function run_build() fi if [ "$(uname)" == "Darwin" ]; then - CMAKE_OPTIONS="${CMAKE_OPTIONS} -DMACOS_OPENSSL_ROOT_DIR=/usr/local/opt/openssl" + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DMACOS_OPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1)" fi if [ ! -z "${SANITIZER}" ]; then diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 5e489d03f5..6b2f505137 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -17,8 +17,8 @@ # under the License. ############################################################################## -project(pegasus_thirdparties) cmake_minimum_required(VERSION 3.11.0) +project(pegasus_thirdparties) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # require at least gcc 7.0.0 @@ -33,6 +33,11 @@ if (APPLE) endif() endif() +# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + cmake_policy(SET CMP0135 NEW) +endif() + include(ExternalProject) include(CheckCXXCompilerFlag) @@ -331,20 +336,30 @@ ExternalProject_Add(nlohmann_json BUILD_IN_SOURCE 1 ) +ExternalProject_Add(abseil + URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.1.tar.gz + URL_MD5 84665b6daa5dda7c9082b1a00057457a + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_CXX_STANDARD=17 + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + DEPENDS googletest + ) + +# TODO(yingchun): check necessary of 'PATCH_COMMAND patch -p0 < ${TP_DIR}/fix_s2_for_aarch64.patch' ExternalProject_Add(s2geometry - URL ${OSS_URL_PREFIX}/s2geometry-e8d16637a467d9f096a92a6d81a50a9b747ca828.zip - https://github.com/neverchanje/s2geometry/archive/e8d16637a467d9f096a92a6d81a50a9b747ca828.zip - URL_MD5 75cc44c9c31382083d8a2d0e42590788 - PATCH_COMMAND patch -p0 < ${TP_DIR}/fix_s2_for_aarch64.patch + URL https://github.com/google/s2geometry/archive/refs/tags/v0.10.0.tar.gz + URL_MD5 c68f3c5d326dde9255681b9201393a9f + DEPENDS abseil CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} - -DGTEST_ROOT=${googletest_SRC}/googletest + -DWITH_GFLAGS=OFF + -DWITH_GLOG=OFF -DBUILD_SHARED_LIBS=OFF - -DBUILD_PYTHON=OFF - -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF + -DWITH_PYTHON=OFF + -DCMAKE_CXX_STANDARD=17 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - DEPENDS googletest ) option(USE_JEMALLOC "use jemalloc" OFF)