From cb4946f644ceb84d28d170ffba29fd5621aaeeac Mon Sep 17 00:00:00 2001 From: Dennis van der Schagt Date: Wed, 6 Mar 2024 19:42:38 +0100 Subject: [PATCH] Compile CXX FFI with C++14 --- Cargo.lock | 16 ++++++++-------- Makefile | 1 + rust/libnewsboat-ffi/build.rs | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 921f38834..e8ca97b63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.118" +version = "1.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673ca5ae28334544ec2a6b18ebe666c42a2650abfb48abbd532ed409a44be2b" +checksum = "635179be18797d7e10edb9cd06c859580237750c7351f39ed9b298bfc17544ad" dependencies = [ "cc", "cxxbridge-flags", @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.118" +version = "1.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df46fe0eb43066a332586114174c449a62c25689f85a08f28fdcc8e12c380b9" +checksum = "9324397d262f63ef77eb795d900c0d682a34a43ac0932bec049ed73055d52f63" dependencies = [ "cc", "codespan-reporting", @@ -183,15 +183,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.118" +version = "1.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886acf875df67811c11cd015506b3392b9e1820b1627af1a6f4e93ccdfc74d11" +checksum = "a87ff7342ffaa54b7c61618e0ce2bbcf827eba6d55b923b83d82551acbbecfe5" [[package]] name = "cxxbridge-macro" -version = "1.0.118" +version = "1.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d151cc139c3080e07f448f93a1284577ab2283d2a44acd902c6fba9ec20b6de" +checksum = "70b5b86cf65fa0626d85720619d80b288013477a91a0389fa8bc716bf4903ad1" dependencies = [ "proc-macro2", "quote", diff --git a/Makefile b/Makefile index 1cdc50cf0..41317a540 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ DEFINES=-DLOCALEDIR='"$(localedir)"' WARNFLAGS=-Werror -Wall -Wextra -Wunreachable-code INCLUDES=-Iinclude -Istfl -Ifilter -I. -Irss -I$(CARGO_TARGET_DIR)/cxxbridge/ +# Keep in sync with c++ version specified in FFI build.rs BARE_CXXFLAGS=-std=c++14 -O2 -ggdb $(INCLUDES) LDFLAGS+=-L. diff --git a/rust/libnewsboat-ffi/build.rs b/rust/libnewsboat-ffi/build.rs index 06e5ef419..17d4d42ed 100644 --- a/rust/libnewsboat-ffi/build.rs +++ b/rust/libnewsboat-ffi/build.rs @@ -1,6 +1,7 @@ fn add_cxxbridge(module: &str) { cxx_build::bridge(format!("src/{module}.rs")) - .flag("-std=c++11") + // Keep in sync with c++ version specified in Makefile + .std("c++14") // Disable warnings in generated code, since we can't affect them directly. We have to do // this because these warnings are turned into errors when we pass `-D warnings` to Cargo // on CI.