Conditional Compile Directive based on build_type

Looking at

which is implemented as

and adding string escaping per Injection of version of the computed libraries - #2 by maxgerhardt, my first guess would be to use

env.Append(CPPDEFINES=[
  ("BUILD_TYPE",  "\\\"%s\\\"" % env.GetBuildType())
])

with testing code

Serial.print("Build type: ");
Serial.println(BUILD_TYPE);
2 Likes