diff --git a/components/bootloader_support/CMakeLists.txt b/components/bootloader_support/CMakeLists.txt index 3c1957473d..d721fef50a 100644 --- a/components/bootloader_support/CMakeLists.txt +++ b/components/bootloader_support/CMakeLists.txt @@ -10,12 +10,16 @@ set(srcs "src/bootloader_clock_init.c" "src/bootloader_mem.c" "src/bootloader_random.c" - "src/bootloader_random_${IDF_TARGET}.c" "src/bootloader_efuse.c" "src/flash_encrypt.c" "src/secure_boot.c" ) +if(NOT CONFIG_IDF_ENV_FPGA) + # For FPGA ENV, bootloader_random implementation is implemented in `bootloader_random.c` + list(APPEND srcs "src/bootloader_random_${IDF_TARGET}.c") +endif() + if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) list(APPEND srcs "bootloader_flash/src/bootloader_flash.c" diff --git a/components/bootloader_support/src/bootloader_random.c b/components/bootloader_support/src/bootloader_random.c index 33fecd77aa..30e1a570cb 100644 --- a/components/bootloader_support/src/bootloader_random.c +++ b/components/bootloader_support/src/bootloader_random.c @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2010-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include "sdkconfig.h" +#include "esp_log.h" #include "bootloader_random.h" #include "esp_cpu.h" #include "soc/wdev_reg.h" @@ -77,12 +78,9 @@ #endif } } +#endif // BOOTLOADER_BUILD -#ifndef CONFIG_IDF_ENV_FPGA - -#else // CONFIG_IDF_ENV_FPGA -#include "esp_log.h" - +#if CONFIG_IDF_ENV_FPGA static void s_non_functional(const char *func) { ESP_EARLY_LOGW("rand", "%s non-functional for FPGA builds", func); @@ -97,7 +95,4 @@ void bootloader_random_disable() { s_non_functional(__func__); } - #endif // CONFIG_IDF_ENV_FPGA - -#endif // BOOTLOADER_BUILD