From 768ac77ea2429329b08808cc5815b391f486b1f9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 13 Jun 2016 19:46:54 +0300 Subject: [PATCH] Pass PlatformIO macros with version to libs --- platformio/builder/tools/platformio.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 93d6e885..863e0ef1 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -35,6 +35,11 @@ SRC_DEFAULT_FILTER = " ".join([ def BuildProgram(env): + env.Append( + CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( + *pioversion_to_intstr())], + ) + # fix ASM handling under non-casitive OS if not case_sensitive_suffixes(".s", ".S"): env.Replace( @@ -78,8 +83,6 @@ def BuildProgram(env): env.ProcessFlags([env.get("SRC_BUILD_FLAGS", None)]) env.Append( - CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( - *pioversion_to_intstr())], CPPPATH=["$PROJECTSRC_DIR"], LIBS=deplibs, LIBPATH=["$BUILD_DIR"]