]> granicus.if.org Git - esp-idf/commitdiff
cmake: Refactor bootloader_subproject into the bootloader component itself
authorAngus Gratton <angus@espressif.com>
Fri, 19 Jan 2018 05:00:41 +0000 (16:00 +1100)
committerAngus Gratton <gus@projectgus.com>
Sun, 29 Apr 2018 23:59:20 +0000 (09:59 +1000)
components/bootloader/project_include.cmake [moved from tools/cmake/bootloader_subproject.cmake with 71% similarity]
components/bootloader/subproject/CMakeLists.txt
tools/cmake/project.cmake

similarity index 71%
rename from tools/cmake/bootloader_subproject.cmake
rename to components/bootloader/project_include.cmake
index c141fadd345a8e323487bd5eaeda46f7dccc3c82..bfefcb8a2afec592726383ceedebd7de79f19876 100644 (file)
@@ -1,18 +1,22 @@
+if(IS_BOOTLOADER_BUILD)
+  return()  # don't keep recursing!
+endif()
+
 # Glue to build the bootloader subproject binary as an external
 # cmake project under this one
 #
 #
-set(bootloader_subproject_build_dir "${CMAKE_BINARY_DIR}/bootloader_subproject")
+set(bootloader_build_dir "${CMAKE_BINARY_DIR}/bootloader")
 set(bootloader_binary_files
-  "${bootloader_subproject_build_dir}/bootloader.elf"
-  "${bootloader_subproject_build_dir}/bootloader.bin"
-  "${bootloader_subproject_build_dir}/bootloader.map"
+  "${bootloader_build_dir}/bootloader.elf"
+  "${bootloader_build_dir}/bootloader.bin"
+  "${bootloader_build_dir}/bootloader.map"
   )
 
-ExternalProject_Add(bootloader_subproject
+ExternalProject_Add(bootloader
   # TODO: support overriding the bootloader in COMPONENT_PATHS
   SOURCE_DIR "${IDF_PATH}/components/bootloader/subproject"
-  BINARY_DIR "${bootloader_subproject_build_dir}"
+  BINARY_DIR "${bootloader_build_dir}"
   CMAKE_ARGS -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH="${IDF_PATH}"
   INSTALL_COMMAND ""
   BUILD_ALWAYS 1  # no easy way around this...
index 1931392d53ef0e6e05f26996811392f4d334767b..f3cc23ac13b5c005cf79b75ba134c5da742e401c 100644 (file)
@@ -12,8 +12,7 @@ set(BOOTLOADER_BUILD 1)
 set(IS_BOOTLOADER_BUILD 1)  # deprecated, use BOOTLOADER_BUILD
 add_definitions(-DBOOTLOADER_BUILD=1)
 
-set(MAIN_SRCS main/bootloader_start.c
-  main/flash_qio_mode.c)
+set(MAIN_SRCS main/bootloader_start.c)
 
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 
index a37d6fd0c511308dd8b94cadbd3996752c3dae57..e8e3cc7ca61c6461995ca4bf332b062a3aff33c9 100644 (file)
@@ -70,11 +70,6 @@ idf_add_executable()
 
 #
 # Finish component registration (add cross-dependencies, make
-# executable dependent on all components.)
+# executable dependent on all components)
 #
 components_finish_registration()
-
-# Define the external target to build the bootloader subproject
-if(NOT BOOTLOADER_BUILD)
-  include(bootloader_subproject)
-endif()