Skip to content

Commit

Permalink
use PKG_ prefix for flags; add -std=c++17
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Dec 5, 2022
1 parent 0603863 commit 7ae5b19
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
@echo on

bash %RECIPE_DIR%/build_win.sh
IF %ERRORLEVEL% NEQ 0 exit 1

cp %RECIPE_DIR%/configure.win r
IF %ERRORLEVEL% NEQ 0 exit 1

cp %RECIPE_DIR%/install.libs.R r/src
IF %ERRORLEVEL% NEQ 0 exit 1

:: translate our default flags for R; set C++17 due to abseil
set "PKG_CFLAGS=%CFLAGS%"
set "PKG_CPPFLAGS=%CPPFLAGS%"
set "PKG_CXXFLAGS=%CXXFLAGS% -std=c++17"

set "MAKEFLAGS=-j%CPU_COUNT%"
"%R%" CMD INSTALL --build r
IF %ERRORLEVEL% NEQ 0 exit 1
8 changes: 7 additions & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/bash
set -ex

export DISABLE_AUTOBREW=1

# translate our default flags for R; set C++17 due to abseil
export PKG_CFLAGS="${CFLAGS}"
export PKG_CPPFLAGS="${CPPFLAGS}"
export PKG_CXXFLAGS="${CXXFLAGS} -std=c++17"

if [[ "${target_platform}" == osx-* ]]; then
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
export PKG_CXXFLAGS="${PKG_CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

# shellcheck disable=SC2086
Expand Down

0 comments on commit 7ae5b19

Please sign in to comment.