Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable C11 and C++17 by default #21

Merged
merged 2 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--/webignore-->

modm (Modular Object-oriented Development for Microcontrollers) is a toolbox for
building custom C++14 libraries tailored to your embedded device.
building custom C++17 libraries tailored to your embedded device.
modm generates startup code, HALs and their implementations, communication
protocols, drivers for external devices, BSPs, etc… in a modular, customizable
process that you can fine-tune to your needs.
Expand Down Expand Up @@ -45,7 +45,7 @@ git clone --recursive https://github.com/modm-io/modm.git

## Features

- Efficient and fast object-oriented C++14 API.
- Efficient and fast object-oriented C++17 API.
- Support for hundreds of AVR and ARM Cortex-M microcontrollers from Atmel and ST.
- Build system agnostic: We use SCons by default, but you don't have to.
- Data-driven HAL generation using the library-builder engine.
Expand Down
2 changes: 1 addition & 1 deletion ext/arm/cmsis
Submodule cmsis updated from e29beb to 64a29d
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SET(CXX_LANG_FLAGS "\
-fno-threadsafe-statics \
-fuse-cxa-atexit \
-Woverloaded-virtual \
-std=c++14")
-std=c++17")

SET(LINK_FLAGS "\
-Llink \
Expand Down
1 change: 1 addition & 0 deletions tools/build_script_generator/scons/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def post_build(env, buildlog):
env.substitutions = {
"partname": target.partname,
"platform": platform,
"family": family,
"compiler": "llvm" if family == "darwin" else "gcc",
"core": core,
"files": files_to_build,
Expand Down
15 changes: 10 additions & 5 deletions tools/build_script_generator/scons/resources/SConstruct.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ env = Environment(
%% endfor
],
CPU="{{ core }}",
CFLAGS_language=["-std=gnu99"],
CFLAGS_language=["-std=gnu11"],
CXXFLAGS_language=["-std=c++17", "-fno-exceptions", "-fno-rtti"],
LINKFLAGS_optimize=[
"-Wl,--relax",
"-Wl,--gc-sections",
Expand Down Expand Up @@ -68,7 +69,8 @@ env.Append(LINKFLAGS_target=[
"-mmcu={{ partname }}",
"-DF_CPU=${CONFIG_CLOCK_F_CPU}"
],
CFLAGS_language=["-std=gnu99"],
CFLAGS_language=["-std=gnu11"],
CXXFLAGS_language=["-std=c++17", "-fno-exceptions", "-fno-rtti"],
LINKFLAGS_other=[
"-Wl,--fatal-warnings",
],
Expand All @@ -94,9 +96,12 @@ env.Append(LINKFLAGS_target=[
"{{tool}}",
%% endfor
],
CXXFLAGS_language=[
"-std=c++14",
],
CFLAGS_language=["-std=gnu11"],
%% if family in ["darwin"]
CXXFLAGS_language=["-std=c++1z"], # for clang 4 or earlier
%% else
CXXFLAGS_language=["-std=c++17"],
%% endif
ENV=os.environ)
%% endif
%# ============================================================================
Expand Down