Skip to content

Commit b5e4913

Browse files
committed
[scons] Use CPP for git info header
1 parent 1b8a534 commit b5e4913

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tools/build_script_generator/scons/module.lb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def build(env):
5757
env.outbasepath = "modm/src/"
5858
if env["info.git"] != "Disabled":
5959
env.collect(":build:gitignore", "modm/src/info_git.c")
60-
env.template("resources/info_git.h.in", "info_git.h",
61-
substitutions={"with_status": "Status" in env["info.git"]},)
60+
env.copy("resources/info_git.h", "info_git.h")
6261
if env["info.build"]:
6362
env.collect(":build:gitignore", "modm/src/info_build.c")
6463
env.copy("resources/info_build.h", "info_build.h")

tools/build_script_generator/scons/resources/info_git.h.in renamed to tools/build_script_generator/scons/resources/info_git.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ extern const char *MODM_GIT_SUBJECT;
3030
extern const char *MODM_GIT_CONFIG_USER_NAME;
3131
extern const char *MODM_GIT_CONFIG_USER_EMAIL;
3232

33-
%% if with_status
33+
#if defined(MODM_GIT_STATUS) && MODM_GIT_STATUS
3434
extern const int16_t MODM_GIT_MODIFIED;
3535
extern const int16_t MODM_GIT_ADDED;
3636
extern const int16_t MODM_GIT_DELETED;
3737
extern const int16_t MODM_GIT_RENAMED;
3838
extern const int16_t MODM_GIT_COPIED;
3939
extern const int16_t MODM_GIT_UNTRACKED;
40-
%% endif
40+
#endif
4141

4242
#ifdef __cplusplus
4343
}

0 commit comments

Comments
 (0)