From 9ee7ffa7951fbf345aa95faaf3a0bf9cb8becbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 1 Mar 2018 06:35:13 +0100 Subject: [PATCH] Disable floating point support when building using PIO --- code/espurna/config/build.h | 5 ----- code/extra_scripts.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 code/espurna/config/build.h diff --git a/code/espurna/config/build.h b/code/espurna/config/build.h deleted file mode 100644 index ef312406..00000000 --- a/code/espurna/config/build.h +++ /dev/null @@ -1,5 +0,0 @@ -// DO NOT EDIT THIS FILE MANUALLY -// This file is modified by PlatformIO -// This file should not be pushed when modified, untrack changes with: -// git update-index --assume-unchanged code/espurna/config/build.h -#define APP_BUILD_FLAGS "" diff --git a/code/extra_scripts.py b/code/extra_scripts.py index fb9faa34..a8f8ae46 100644 --- a/code/extra_scripts.py +++ b/code/extra_scripts.py @@ -34,6 +34,18 @@ def clr(color, text): # Callbacks # ------------------------------------------------------------------------------ +def remove_float_support(): + + flags = " ".join(env['LINKFLAGS']) + print flags + flags = flags.replace("-u _printf_float", "") + flags = flags.replace("-u _scanf_float", "") + newflags = flags.split() + + env.Replace( + LINKFLAGS = newflags + ) + def cpp_check(source, target, env): print("Started cppcheck...\n") call(["cppcheck", os.getcwd()+"/espurna", "--force", "--enable=all"]) @@ -63,6 +75,8 @@ def add_build_flags(source, target, env): # Hooks # ------------------------------------------------------------------------------ +remove_float_support() + #env.AddPreAction("buildprog", cpp_check) env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags) env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size)