diff --git a/.travis.yml b/.travis.yml index 92ac917fa0..ac98a24261 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,6 +93,7 @@ env: - PX4_AWS_BUCKET=px4-travis script: + - git submodule update --init --recursive - make check_format - arm-none-eabi-gcc --version - echo 'Building POSIX Firmware..' && make posix_sitl_default diff --git a/Makefile b/Makefile index 56b4f663a6..667897ed4b 100644 --- a/Makefile +++ b/Makefile @@ -109,8 +109,9 @@ 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 ++git submodule init +Tools/check_submodules.sh -+@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1); fi ++@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then git submodule sync && git submodule init && 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