From b57b633f2d7ba7d18d9c39710d5a45040a1751ce Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Sat, 19 May 2018 19:43:02 +0200 Subject: [PATCH 1/2] [ext] Update CMSIS for removal of register keyword --- ext/arm/cmsis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/arm/cmsis b/ext/arm/cmsis index e29bebd58f..64a29d3845 160000 --- a/ext/arm/cmsis +++ b/ext/arm/cmsis @@ -1 +1 @@ -Subproject commit e29bebd58f728cae3625f6563e1d975bfc2b7fa2 +Subproject commit 64a29d38459cc1613593786520b02e6e76257dd4 From c4d4a52f964731eb1de2334f1f812f9b8c1569d9 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Tue, 22 May 2018 02:53:31 +0200 Subject: [PATCH 2/2] [scons] Enable C11 and C++17 by default --- README.md | 4 ++-- .../cmake/cmake_scripts/configure-stm32-gcc.cmake | 2 +- tools/build_script_generator/scons/module.lb | 1 + .../scons/resources/SConstruct.in | 15 ++++++++++----- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index da2bd5b75e..4dc3c2af76 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 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. @@ -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. diff --git a/tools/build_script_generator/cmake/cmake_scripts/configure-stm32-gcc.cmake b/tools/build_script_generator/cmake/cmake_scripts/configure-stm32-gcc.cmake index 23fbdbb999..f6d4724827 100644 --- a/tools/build_script_generator/cmake/cmake_scripts/configure-stm32-gcc.cmake +++ b/tools/build_script_generator/cmake/cmake_scripts/configure-stm32-gcc.cmake @@ -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 \ diff --git a/tools/build_script_generator/scons/module.lb b/tools/build_script_generator/scons/module.lb index 4b7e9639a0..38d99d7847 100644 --- a/tools/build_script_generator/scons/module.lb +++ b/tools/build_script_generator/scons/module.lb @@ -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, diff --git a/tools/build_script_generator/scons/resources/SConstruct.in b/tools/build_script_generator/scons/resources/SConstruct.in index 2cb6a4a23f..c194cd09ce 100644 --- a/tools/build_script_generator/scons/resources/SConstruct.in +++ b/tools/build_script_generator/scons/resources/SConstruct.in @@ -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", @@ -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", ], @@ -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 %# ============================================================================