CMakeLists.txt 955 B

123456789101112131415161718
  1. idf_build_get_property(target IDF_TARGET)
  2. if(${target} STREQUAL "linux")
  3. return() # This component is not supported by the POSIX/Linux simulator
  4. endif()
  5. idf_component_register(SRCS "nvs_sec_provider.c"
  6. INCLUDE_DIRS include
  7. PRIV_REQUIRES bootloader_support efuse esp_partition nvs_flash)
  8. # NOTE: In a case where only the default NVS partition is to be encrypted
  9. # and no custom NVS partitions exist, `nvs_flash_init` is the only API that
  10. # needs to be called. No API from the `nvs_sec_provider` component is called
  11. # as neither the `nvs_flash` component nor the user app depends on it.
  12. # Thus, the symbols from this component are not placed in the .map file and
  13. # hence the constructor, which initialises the encryption scheme for the default
  14. # NVS partition, never executes. The following is a workaround for the same.
  15. target_link_libraries(${COMPONENT_LIB} PRIVATE "-u nvs_sec_provider_include_impl")