mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 02:53:34 +08:00
list_vmd_make_targets and list_cmake_targets
* This allows one to run 'make posix list_vmd_make_targets' and get output like >make posix list_vmd_make_targets [...] -- Build files have been written to: /usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default PX4 CONFIG: /usr/src/debian/px4/Firmware/Firmware.git/build_posix_sitl_default Scanning dependencies of target list_vmd_make_targets [100%] List of acceptable 'posix_sitl_default' <viewer_model_debugger> targets: none none_iris none_iris_opt_flow none_tailsitter [...] replay_solo_valgrind replay_typhoon_h480_valgrind [100%] Built target list_vmd_make_targets Or, run 'make list_vmd_make_targets' from the build_posix_* directory. * This adds the list_cmake_targets make target to print all cmake targets that one can match with PX4_NO_OPTIMIZATION. PX4_NO_OPTIMIZATION is ignored (do optimization as normal) when the CONFIG isn't posix_sitl_*. * Add comment in Makefile on how/where to find all targets.
This commit is contained in:
@@ -1061,14 +1061,21 @@ endfunction()
|
||||
#
|
||||
# px4_add_optimization_flags_for_target
|
||||
#
|
||||
set(all_posix_cmake_targets "" CACHE INTERNAL "All cmake targets for which optimization can be suppressed")
|
||||
function(px4_add_optimization_flags_for_target target)
|
||||
set(_no_optimization_for_target FALSE)
|
||||
foreach(_regexp $ENV{PX4_NO_OPTIMIZATION})
|
||||
if("${target}" MATCHES "${_regexp}")
|
||||
set(_no_optimization_for_target TRUE)
|
||||
set(_matched_regexp "${_regexp}")
|
||||
endif()
|
||||
endforeach()
|
||||
# If the current CONFIG is posix_sitl_* then suppress optimization for certain targets.
|
||||
if(CONFIG MATCHES "^posix_sitl_")
|
||||
foreach(_regexp $ENV{PX4_NO_OPTIMIZATION})
|
||||
if("${target}" MATCHES "${_regexp}")
|
||||
set(_no_optimization_for_target TRUE)
|
||||
set(_matched_regexp "${_regexp}")
|
||||
endif()
|
||||
endforeach()
|
||||
# Create a full list of targets that optimization can be suppressed for.
|
||||
list(APPEND all_posix_cmake_targets ${target})
|
||||
set(all_posix_cmake_targets ${all_posix_cmake_targets} CACHE INTERNAL "All cmake targets for which optimization can be suppressed")
|
||||
endif()
|
||||
if(NOT ${_no_optimization_for_target})
|
||||
target_compile_options(${target} PRIVATE ${optimization_flags})
|
||||
else()
|
||||
|
||||
Reference in New Issue
Block a user