Open-CMSIS-Pack / cbuild2cmake

A command line tool that generates CMakeLists.txt file from *.cbuild.yml files generated by csolution
Apache License 2.0
4 stars 2 forks source link

Executes commands can't depend on .bin or .hex files #126

Closed EaselinkBachmann closed 4 months ago

EaselinkBachmann commented 4 months ago

Executes commands can't depend on .bin files generated using the

output:
  type:
    - bin

syntax.

The generated super-CMakeLists doesn't know about the generated .bin or .hex files since only the elf files are listed as BUILD_BYPRODUCTS for the inner CMakeLists.

This results in the following error when an executes: build step depends on the .bin file:

-- Build files have been written to: /path/to/solution/tmp
ninja: error: '/path/to/solution/out/project/context/output.bin', needed by '/path/to/solution/out/project/context/executes_generated.bin', missing and no known rule to make it
EaselinkBachmann commented 4 months ago

This is nontrivial to fix, since superlists.go curerntly generates a CMakeLists that assumes every Cbuild only has a single output file (getting a single element from the OUTPUTS array), but shouldn't require changes elsewhere other than the way output files are passed to ExternalProject_Add.

EDIT: Fix was fairly trivial.