Skip to content
Snippets Groups Projects
Commit aff78e0f authored by Lorenz Meier's avatar Lorenz Meier
Browse files

CMake / Ninja: Use console flag so upload targets can print their normal output and receive input.

parent 94bef4e1
No related branches found
No related tags found
No related merge requests found
......@@ -68,11 +68,11 @@ ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
# disable ninja by default for now because it hides upload progress
#NINJA_BUILD := $(shell ninja --version 2>/dev/null)
NINJA_BUILD := $(shell ninja --version 2>/dev/null)
ifdef NINJA_BUILD
PX4_CMAKE_GENERATOR ?= "Ninja"
PX4_MAKE = ninja
PX4_MAKE_ARGS =
PX4_MAKE_ARGS =
else
ifdef SYSTEMROOT
......@@ -89,6 +89,7 @@ endif
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@if [ $(PX4_CMAKE_GENERATOR) == "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi
+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then git submodule update --init --recursive --force && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1); fi
+$(PX4_MAKE) -C $(PWD)/build_$@ $(PX4_MAKE_ARGS) $(ARGS)
endef
......
......@@ -433,6 +433,7 @@ function(px4_add_upload)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "uploading ${BUNDLE}"
VERBATIM
USES_TERMINAL
)
endfunction()
......
......@@ -28,6 +28,7 @@ add_custom_target(run_sitl
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}" "${config_sitl_debugger}"
"${config_sitl_viewer}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(run_sitl mainapp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment