Browse Source

[BUILD] Print the number of targets for the current toolchain with cmake

master
Alberto García Hierro 4 years ago
parent
commit
49b9347b10
  1. 8
      cmake/main.cmake

8
cmake/main.cmake

@ -52,7 +52,8 @@ function(setup_firmware_target name)
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
set_property(GLOBAL PROPERTY VALID_TARGETS "${targets} ${name}")
list(APPEND targets ${name})
set_property(GLOBAL PROPERTY VALID_TARGETS "${targets}")
setup_openocd(${name})
setup_svd(${name})
endfunction()
@ -67,8 +68,11 @@ endfunction()
function(collect_targets)
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
list(SORT targets)
list(JOIN targets " " target_names)
set(list_target_name "targets")
add_custom_target(${list_target_name}
COMMAND cmake -E echo "Valid targets: ${targets}")
COMMAND cmake -E echo "Valid targets: ${target_names}")
exclude_from_all(${list_target_name})
list(LENGTH targets target_count)
message("-- ${target_count} targets found for toolchain ${TOOLCHAIN}")
endfunction()
Loading…
Cancel
Save