Skip to content

Commit 834017e

Browse files
committed
Allow specifying custom PROJECT_VER, PROJECT_NAME
1 parent f4b9153 commit 834017e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

builder/frameworks/espidf.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,7 @@ def configure_exceptions(sdk_params):
657657
"WITH_POSIX",
658658
"UNITY_INCLUDE_CONFIG_H",
659659
("IDF_VER", '\\"%s\\"' %
660-
platform.get_package_version("framework-espidf")),
661-
("PROJECT_VER", '\\"%s\\"' % "1.0.0"),
662-
("PROJECT_NAME", '\\"%s\\"' % basename(env.subst("$PROJECT_DIR")))
660+
platform.get_package_version("framework-espidf"))
663661

664662
],
665663

@@ -697,6 +695,18 @@ def configure_exceptions(sdk_params):
697695
]
698696
)
699697

698+
cppdefines = env.Flatten(env.get("CPPDEFINES", []))
699+
700+
if "PROJECT_NAME" not in cppdefines:
701+
env.Append(
702+
CPPDEFINES=[
703+
("PROJECT_NAME", '\\"%s\\"' % basename(env.subst("$PROJECT_DIR")))
704+
]
705+
)
706+
707+
if "PROJECT_VER" not in cppdefines:
708+
env.Append(CPPDEFINES=[("PROJECT_VER", '\\"%s\\"' % "1.0.0")])
709+
700710
#
701711
# ESP-IDF doesn't need assembler-with-cpp option
702712
#

0 commit comments

Comments
 (0)