Skip to content

Commit 7f8cb65

Browse files
committed
More robust compiler flags
1 parent 28a2b08 commit 7f8cb65

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

configure

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ PKG_LIBS="-lpthread"
99

1010
# Find compiler and export flags
1111
CC=`"${R_HOME}/bin/R" CMD config CC`
12-
export CC
12+
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
13+
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
14+
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`
15+
export CC CFLAGS CPPFLAGS LDFLAGS
1316

1417
if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]; then
1518
export MACOSX_DEPLOYMENT_TARGET=`echo $CC | sed -En 's/.*-version-min=([0-9][0-9.]*).*/\1/p'`

configure.ucrt

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ LIB_VER="5c443d2"
33

44
# Find compiler and export flags
55
CC=`"${R_HOME}/bin/R" CMD config CC`
6-
export CC
6+
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
7+
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
8+
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`
9+
export CC CFLAGS CPPFLAGS LDFLAGS
710

811
echo "Compiling 'libfswatch' from source..."
912
gzip -dc src/fswatch-$LIB_VER.tar.gz | tar -xf -

configure.win

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ for ARCH in x64 i386; do
77

88
if [ -e "${R_HOME}/bin/${ARCH}/R" ]; then
99
CC=`"${R_HOME}/bin/${ARCH}/R" CMD config CC`
10-
export CC
10+
CFLAGS=`"${R_HOME}/${ARCH}/bin/R" CMD config CFLAGS`
11+
CPPFLAGS=`"${R_HOME}/${ARCH}/bin/R" CMD config CPPFLAGS`
12+
LDFLAGS=`"${R_HOME}/${ARCH}/bin/R" CMD config LDFLAGS`
13+
export CC CFLAGS CPPFLAGS LDFLAGS
1114

1215
echo "Compiling 'libfswatch' from source..."
1316

tests/testthat/test-watch.R

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test_that("watcher() logs", {
2525
})
2626

2727
test_that("watcher() callbacks", {
28+
skip_if(R.version$arch == "aarch64" && !Sys.getenv("NOT_CRAN") == "true")
2829
x <- 0L
2930
w <- watcher(c(dir, dir2), callback = ~{is.character(.x) || stop(); x <<- x + 1L}, latency = 0.2)
3031
expect_output(print(w))

0 commit comments

Comments
 (0)