This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new a35fae0f1 fix(r): Ensure CXX_STD is set everywhere (#1706)
a35fae0f1 is described below
commit a35fae0f11c29b6207c1361986d7900441562d64
Author: Dewey Dunnington <[email protected]>
AuthorDate: Wed Apr 3 17:28:24 2024 -0300
fix(r): Ensure CXX_STD is set everywhere (#1706)
Upon submitting adbcpostgresql to CRAN, there is now a build error for R
4.1 on Windows, which uses C++14 as its default standard if unspecified.
This gives:
```
g++ -std=gnu++14 -I"D:/RCompile/recent/R-4.2.3/include" -DNDEBUG -I../src
-DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO
-I"d:/rtools42/x86_64-w64-mingw32.static.posix/include" -pedantic -O2 -Wall
-mfpmath=sse -msse2 -mstackrealign -c connection.cc -o connection.o
In file included from connection.cc:37:
result_helper.h:37:8: error: 'optional' in namespace 'std' does not name a
template type
37 | std::optional<double> ParseDouble() const {
| ^~~~~~~~
result_helper.h:37:3: note: 'std::optional' is only available from C++17
onwards
```
https://www.r-project.org/nosvn/R.check/r-oldrel-windows-x86_64/adbcpostgresql-00install.html
---
r/adbcdrivermanager/src/Makevars | 1 +
r/adbcpostgresql/src/Makevars.ucrt | 1 +
r/adbcsqlite/src/Makevars.in | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/r/adbcdrivermanager/src/Makevars b/r/adbcdrivermanager/src/Makevars
index 5ccd1e4ef..ffcee27b8 100644
--- a/r/adbcdrivermanager/src/Makevars
+++ b/r/adbcdrivermanager/src/Makevars
@@ -15,4 +15,5 @@
# specific language governing permissions and limitations
# under the License.
+CXX_STD = CXX17
PKG_CPPFLAGS=-I../src -DADBC_EXPORT=""
diff --git a/r/adbcpostgresql/src/Makevars.ucrt
b/r/adbcpostgresql/src/Makevars.ucrt
index 55f722832..857c45b77 100644
--- a/r/adbcpostgresql/src/Makevars.ucrt
+++ b/r/adbcpostgresql/src/Makevars.ucrt
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
+CXX_STD = CXX17
PKG_CPPFLAGS = -I../src -I../src/c/ -I../src/c/vendor/
-I../src/c/vendor/fmt/include/ -DADBC_EXPORT="" -D__USE_MINGW_ANSI_STDIO
-DFMT_HEADER_ONLY=1
PKG_LIBS = -lpq -lpgcommon -lpgport -lssl -lcrypto -lz -lsecur32 -lws2_32
-lwldap32 -lcrypt32
diff --git a/r/adbcsqlite/src/Makevars.in b/r/adbcsqlite/src/Makevars.in
index bd1e4419a..67ec63752 100644
--- a/r/adbcsqlite/src/Makevars.in
+++ b/r/adbcsqlite/src/Makevars.in
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-CXXSTD = CXX17
+CXX_STD = CXX17
PKG_CPPFLAGS=-I../src/ -I../src/c/ -I../src/c/vendor/
-I../src/c/vendor/fmt/include/ @cppflags@ -DADBC_EXPORT="" -DFMT_HEADER_ONLY=1
-D_LIBCPP_DISABLE_AVAILABILITY
PKG_LIBS=@libs@