Skip to content

Commit

Permalink
Explicitly prepend python as the command's interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
elfmimi committed Mar 14, 2021
1 parent c4f4918 commit 18399bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions project_generator/templates/cmakelist_gccarm.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ add_custom_command(OUTPUT "${OUTPUT_DIR}/{{name}}.hex" DEPENDS {{name}}
add_custom_target({{name}}_binaries ALL DEPENDS {{name}} DEPENDS {{name}}_bin DEPENDS {{name}}_hex)

{% if pre_build_script %}
add_custom_target({{name}}_pre_build {% for command in pre_build_script %}
COMMAND {{command}}{% endfor %}
add_custom_target({{name}}_pre_build {% for command in pre_build_script %}{% if command.endswith('.py') %}
COMMAND python {{command}}{% else %}
COMMAND {{command}}{% endif %}{% endfor %}
WORKING_DIRECTORY ${BUILD_DIR})
add_dependencies({{name}} {{name}}_pre_build)
{% endif %}

{% if post_build_script %}
add_custom_command(TARGET {{name}}_binaries POST_BUILD{% for command in post_build_script %}
COMMAND {{command}}{% endfor %}
add_custom_command(TARGET {{name}}_binaries POST_BUILD{% for command in post_build_script %}{% if command.endswith('.py') %}
COMMAND python {{command}}{% else %}
COMMAND {{command}}{% endif %}{% endfor %}
WORKING_DIRECTORY ${BUILD_DIR})
{% endif %}

0 comments on commit 18399bf

Please sign in to comment.