]> granicus.if.org Git - esp-idf/commitdiff
cmake: fix custom bootloader issue
authorRenz Christian Bagaporo <renz@espressif.com>
Wed, 15 May 2019 03:40:57 +0000 (11:40 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Mon, 27 May 2019 10:45:28 +0000 (18:45 +0800)
Issue is that when users creates a custom bootloader from
$IDF_PATH/components/bootloader. Parent project build uses the copy but
bootloader subproject build uses the original still. The issue is solved
by passing the custom bootloader as extra component directory so
bootloader build knows to use the new copy (itself) in the build.

components/bootloader/project_include.cmake

index cdb18a9fa038501a7e171699ddaef67c77e57895..4b0137e949266526ee3a2136e95be835022b732f 100644 (file)
@@ -15,9 +15,10 @@ set(bootloader_binary_files
 
 externalproject_add(bootloader
     # TODO: support overriding the bootloader in COMPONENT_PATHS
-    SOURCE_DIR "${IDF_PATH}/components/bootloader/subproject"
+    SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/subproject"
     BINARY_DIR "${bootloader_build_dir}"
-    CMAKE_ARGS -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH=${IDF_PATH}
+    CMAKE_ARGS  -DSDKCONFIG=${SDKCONFIG} -DIDF_PATH=${IDF_PATH}
+                -DEXTRA_COMPONENT_DIRS=${CMAKE_CURRENT_LIST_DIR}
     INSTALL_COMMAND ""
     BUILD_ALWAYS 1  # no easy way around this...
     BUILD_BYPRODUCTS ${bootloader_binary_files}