Skip to content

Commit

Permalink
Added the Abseil library which is now a dependency of RE2
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov committed Dec 16, 2024
1 parent 0844c90 commit 9bc2ac4
Show file tree
Hide file tree
Showing 480 changed files with 102,147 additions and 3 deletions.
1 change: 1 addition & 0 deletions 3rd_Party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Verify the Xcode version with `xcode-select -p`.

| Library | Version | Released | Source Code
| --------------- | ---------- | ---------- | -----------------------------------------
| abseil | 2024.07.22 | 2024.08.01 | https://github.com/abseil/abseil-cpp.git
| appauth | 1.7.5 | 2024.04.23 | https://github.com/openid/AppAuth-iOS.git
| boost | 1.85.0 | 2024.04.15 | https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.gz
| bz2 | 1.0.8 | 2019.07.13 | https://sourceware.org/git/bzip2.git
Expand Down
36 changes: 36 additions & 0 deletions 3rd_Party/abseil/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh
set -o pipefail
set -o xtrace
set -e

CUR_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )
TMP_DIR=${CUR_DIR}/abseil.tmp

mkdir ${TMP_DIR}
cd ${TMP_DIR}

git clone -b 20240722.0 --single-branch --depth=1 https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
mkdir build_cmake
cd build_cmake
cmake \
-D CMAKE_BUILD_TYPE=Release\
-D CMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-D CMAKE_OSX_DEPLOYMENT_TARGET="10.15" \
-D CMAKE_CXX_FLAGS="-fvisibility=hidden -flto -Os" \
-D CMAKE_CXX_STANDARD="23" \
-D CMAKE_INSTALL_PREFIX="${TMP_DIR}" \
-D BUILD_SHARED_LIBS=OFF \
-D BUILD_TESTING=OFF\
..
cmake --build . --target install -j

cd ../../..

rm -rf ./include/
rm -rf ./lib/
cp -r ./abseil.tmp/include .
cp -r ./abseil.tmp/lib .
rm -rf ./lib/pkgconfig

rm -rf ${TMP_DIR}
64 changes: 64 additions & 0 deletions 3rd_Party/abseil/include/absl/algorithm/algorithm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// -----------------------------------------------------------------------------
// File: algorithm.h
// -----------------------------------------------------------------------------
//
// This header file contains Google extensions to the standard <algorithm> C++
// header.

#ifndef ABSL_ALGORITHM_ALGORITHM_H_
#define ABSL_ALGORITHM_ALGORITHM_H_

#include <algorithm>
#include <iterator>
#include <type_traits>

#include "absl/base/config.h"

namespace absl {
ABSL_NAMESPACE_BEGIN

// equal()
// rotate()
//
// Historical note: Abseil once provided implementations of these algorithms
// prior to their adoption in C++14. New code should prefer to use the std
// variants.
//
// See the documentation for the STL <algorithm> header for more information:
// https://en.cppreference.com/w/cpp/header/algorithm
using std::equal;
using std::rotate;

// linear_search()
//
// Performs a linear search for `value` using the iterator `first` up to
// but not including `last`, returning true if [`first`, `last`) contains an
// element equal to `value`.
//
// A linear search is of O(n) complexity which is guaranteed to make at most
// n = (`last` - `first`) comparisons. A linear search over short containers
// may be faster than a binary search, even when the container is sorted.
template <typename InputIterator, typename EqualityComparable>
bool linear_search(InputIterator first, InputIterator last,
const EqualityComparable& value) {
return std::find(first, last, value) != last;
}

ABSL_NAMESPACE_END
} // namespace absl

#endif // ABSL_ALGORITHM_ALGORITHM_H_
Loading

0 comments on commit 9bc2ac4

Please sign in to comment.