Skip to content

Commit f7595f1

Browse files
committed
build: add and use CXX_STANDARD in depends
1 parent 7e7b3e4 commit f7595f1

File tree

11 files changed

+9
-8
lines changed

11 files changed

+9
-8
lines changed

depends/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ LTO ?=
4646
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
4747

4848
C_STANDARD ?= c11
49+
CXX_STANDARD ?= c++17
4950

5051
BUILD = $(shell ./config.guess)
5152
HOST ?= $(BUILD)

depends/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ The following can be set when running make: `make FOO=bar`
9797
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
9898
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
9999
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
100+
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
100101
- `NO_QT`: Don't download/build/cache Qt and its dependencies
101102
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
102103
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ

depends/hosts/android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang
77
endif
88

99
android_CFLAGS=-std=$(C_STANDARD)
10+
android_CXXFLAGS=-std=$(CXX_STANDARD)
1011

1112
ifneq ($(LTO),)
1213
android_CFLAGS += -flto

depends/hosts/darwin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
110110
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
111111

112112
darwin_CFLAGS=-pipe -std=$(C_STANDARD)
113-
darwin_CXXFLAGS=-pipe
113+
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
114114

115115
ifneq ($(LTO),)
116116
darwin_CFLAGS += -flto

depends/hosts/freebsd.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
freebsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
freebsd_CXXFLAGS=-pipe
2+
freebsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
33

44
ifneq ($(LTO),)
55
freebsd_CFLAGS += -flto

depends/hosts/linux.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
linux_CFLAGS=-pipe -std=$(C_STANDARD)
2-
linux_CXXFLAGS=-pipe
2+
linux_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
33

44
ifneq ($(LTO),)
55
linux_CFLAGS += -flto

depends/hosts/mingw32.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mingw32_CXX := $(host)-g++-posix
33
endif
44

55
mingw32_CFLAGS=-pipe -std=$(C_STANDARD)
6-
mingw32_CXXFLAGS=-pipe
6+
mingw32_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
77

88
ifneq ($(LTO),)
99
mingw32_CFLAGS += -flto

depends/hosts/netbsd.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
netbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
netbsd_CXXFLAGS=-pipe
2+
netbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
33

44
ifneq ($(LTO),)
55
netbsd_CFLAGS += -flto

depends/hosts/openbsd.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
openbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2-
openbsd_CXXFLAGS=-pipe
2+
openbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
33

44
ifneq ($(LTO),)
55
openbsd_CFLAGS += -flto

depends/packages/bdb.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ $(package)_config_opts_netbsd=--with-pic
1515
$(package)_config_opts_openbsd=--with-pic
1616
$(package)_config_opts_android=--with-pic
1717
$(package)_cflags+=-Wno-error=implicit-function-declaration
18-
$(package)_cxxflags+=-std=c++17
1918
$(package)_cppflags_mingw32=-DUNICODE -D_UNICODE
2019
endef
2120

0 commit comments

Comments
 (0)