Skip to content

Commit b971b05

Browse files
authored
Merge pull request #442 from sej7278/master
Change CXXFLAGS_STD to match upstream
2 parents 77431bf + e4b3060 commit b971b05

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Arduino.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,12 @@ ifndef AVR_TOOLS_PATH
472472
AVR_TOOLS_PATH = $(AVR_TOOLS_DIR)/bin
473473
endif
474474

475-
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
476-
$(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
475+
ifndef ARDUINO_LIB_PATH
476+
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
477+
$(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
478+
else
479+
$(call show_config_variable,ARDUINO_LIB_PATH,[USER])
480+
endif
477481

478482
# 1.5.x platform dependent libs path
479483
ifndef ARDUINO_PLATFORM_LIB_PATH
@@ -1035,7 +1039,11 @@ else
10351039
endif
10361040

10371041
ifndef CXXFLAGS_STD
1038-
CXXFLAGS_STD =
1042+
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
1043+
CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics
1044+
else
1045+
CXXFLAGS_STD =
1046+
endif
10391047
$(call show_config_variable,CXXFLAGS_STD,[DEFAULT])
10401048
else
10411049
$(call show_config_variable,CXXFLAGS_STD,[USER])

arduino-mk-vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ CFLAGS_STD = = -std=gnu89
929929

930930
Controls, *exclusively*, which C++ standard is to be used for compilation.
931931

932-
Defaults to `undefined`
932+
Defaults to `undefined` on 1.0 or `-std=gnu++11 -fno-threadsafe-statics` on 1.5+
933933

934934
Possible values:
935935

0 commit comments

Comments
 (0)