Skip to content

Commit 11a4957

Browse files
committed
attempt to accommodate CRAN's lack of cygpath
1 parent 529b7f4 commit 11a4957

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Makevars.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ifeq ($(OS), Windows_NT)
99
MAKE = make -e
1010
MAKE_CMD = \
1111
CYGWIN=nodosfilewarning \
12-
CONLY="$(shell cygpath -m "@CC@")" \
13-
CPLUS="$(shell cygpath -m "@CXX11@")" \
12+
CONLY="@WINDOWS_CC@" \
13+
CPLUS="@WINDOWS_CXX11@" \
1414
CXXFLAGS="@CXX11FLAGS@ -DTBB_NO_LEGACY=1" \
1515
PIC_KEY="@CXX11PICFLAGS@" \
1616
WARNING_SUPPRESS="" \

tools/config/configure.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ switch(
5454
stop("Failed to infer C / C++ compilation flags")
5555
)
5656

57+
# define special flags for Windows
58+
db <- configure_database()
59+
if (Sys.info()[["sysname"]] == "Windows") {
60+
61+
cygpath <- nzchar(Sys.which("cygpath"))
62+
fmt <- if (cygpath) "$(shell cygpath -m \"%s\")" else "%s"
63+
define(
64+
WINDOWS_CC = sprintf(fmt, db$CC),
65+
WINDOWS_CXX11 = sprintf(fmt, db$CXX11)
66+
)
67+
68+
}
69+
5770
# use c++0x for compatibility with older compilers
5871
define(STDVER = "c++0x")
5972

0 commit comments

Comments
 (0)