Skip to content

Commit

Permalink
reasonable path to not awful dev setup without system abseil
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jun 17, 2024
1 parent 00fdc08 commit a708548
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ if [ -z "${R_S2_ABSL_HOME}" ] && pkg-config absl_base --libs 2>/dev/null; then
PKG_LIBS="${PKGCONFIG_LIBS} ${PKG_LIBS}"
else
# Allow developers to set R_S2_ABSL_HOME in .Renviron to avoid building
# Abseil on every package rebuild.
# Abseil on every package rebuild. This can be built from this directory using
# tools/build_absl.sh path/to/dir (then R_S2_ABSL_HOME=path/to/dir in .Renviron)
if [ -z "$R_S2_ABSL_HOME" ]; then
echo "** Building abseil-cpp using cmake"
if tools/build_absl.sh; then
CMAKE_INSTALL_PREFIX="`pwd`/tools/dist"
if tools/build_absl.sh "${CMAKE_INSTALL_PREFIX}"; then
echo "** Done!"
else
echo "** CMake build of Abseil failed"
Expand Down
3 changes: 2 additions & 1 deletion configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ if pkg-config absl_base --libs 2>/dev/null; then
echo "Using Abseil from RTools via pkg-config"
else
# Build the libraries
WIN_CPPFLAGS="-DABSL_FORCE_WAITER_MODE=4" tools/build_absl.sh
CMAKE_INSTALL_PREFIX="`pwd`/tools/dist"
WIN_CPPFLAGS="-DABSL_FORCE_WAITER_MODE=4" tools/build_absl.sh "${CMAKE_INSTALL_PREFIX}"

# Remove the build directory (its existence causes a check warning on R 4.2)
rm -rf tools/build
Expand Down
4 changes: 1 addition & 3 deletions tools/build_absl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ R_CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
R_CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXX17FLAGS`
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`

CMAKE_INSTALL_PREFIX="`pwd`/tools/dist"
CMAKE_PREFIX_PATH="`pwd`/tools/dist/lib/cmake:${CMAKE_PREFIX_PATH}"
CMAKE_INSTALL_PREFIX="$1"

if [ ! -d "tools/build/abseil-cpp" ]; then
mkdir -p "tools/build/abseil-cpp"
Expand All @@ -50,7 +49,6 @@ cd "tools/build/abseil-cpp"
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.3 \
-DCMAKE_CXX_STANDARD=17 \
-DABSL_PROPAGATE_CXX_STD=ON \
Expand Down

0 comments on commit a708548

Please sign in to comment.