GENERATE_BIN & GENERATE_HEX

Sysprogs forums Forums VisualGDB GENERATE_BIN & GENERATE_HEX

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35856
    bflannery
    Participant

    I have a project containing a bootloader and application target. Both targets are added in CMAKE using add_bsp_based_executable()

    For both targets I add these flags:

    GENERATE_BIN

    GENERATE_HEX

    When I build at the solution or CMake project level it will produce a .bin and .hex for both targets.

    If I right click on the specific bsp_exe target in the solution explorer and click “build target(s)” it will not produce a .bin or .hex file. I would expect that when I build each target individually that these files are also produced, however that is not the case.

    This causes issues for me because of post-build actions that depend on these files being created. The post build actions will run regardless of the two methods above used to build. However, when you build the specific target the .hex and .bin files will be outdated or missing.

    #35857
    support
    Keymaster

    Hi,

    Sorry, this is the side effect of how per-target building is handled. VisualGDB shows relevant CMake targets in Solution Explorer and allows building them via context menu. Generation of binary/hex files is done via separate CMake targets, so when you request CMake to build the actual executable target, it won’t build those.

    If you have a complex scenario where another target requires these files, you can add an explicit dependency from that target to the binary file-building targets, so CMake will build them whenever it builds the target using them.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.