@@ -33,9 +33,11 @@ set(AVM_SYS_COMPONENT_SRCS
3333 "../../../../libAtomVM/portnifloader.c"
3434)
3535
36- if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
37- set (ADDITIONAL_COMPONENTS "esp_partition" )
38- # available starting from v4.4
36+ if (IDF_VERSION_MAJOR GREATER_EQUAL 6)
37+ set (ADDITIONAL_COMPONENTS "esp_partition" "esp_driver_ledc" "esp_driver_uart" )
38+ set (ADDITIONAL_PRIV_REQUIRES "esp_hw_support" )
39+ elseif (IDF_VERSION_MAJOR GREATER_EQUAL 5 AND IDF_VERSION_MAJOR LESS 6)
40+ set (ADDITIONAL_COMPONENTS "newlib" "esp_partition" )
3941 set (ADDITIONAL_PRIV_REQUIRES "esp_hw_support" )
4042else ()
4143 set (ADDITIONAL_COMPONENTS "" )
@@ -45,7 +47,7 @@ endif()
4547idf_component_register(
4648 SRCS ${AVM_SYS_COMPONENT_SRCS}
4749 INCLUDE_DIRS "include"
48- REQUIRES "spi_flash" "soc" "newlib" " pthread" "vfs" "mbedtls" ${ADDITIONAL_COMPONENTS}
50+ REQUIRES "spi_flash" "soc" "pthread" "vfs" "mbedtls" ${ADDITIONAL_COMPONENTS}
4951 PRIV_REQUIRES "libatomvm" "esp_timer" ${ADDITIONAL_PRIV_REQUIRES}
5052)
5153
@@ -54,8 +56,15 @@ target_compile_features(${COMPONENT_LIB} INTERFACE c_std_11)
5456idf_component_get_property(soc_dir soc COMPONENT_DIR)
5557idf_component_get_property(soc_include_dirs soc INCLUDE_DIRS)
5658idf_build_get_property(idf_target IDF_TARGET)
59+
60+ if (IDF_VERSION_MAJOR LESS 6)
5761idf_component_get_property(newlib_dir newlib COMPONENT_DIR)
5862idf_component_get_property(newlib_include_dirs newlib INCLUDE_DIRS)
63+ else ()
64+ idf_component_get_property(newlib_dir esp_libc COMPONENT_DIR)
65+ idf_component_get_property(newlib_include_dirs esp_libc INCLUDE_DIRS)
66+ endif ()
67+
5968idf_component_get_property(pthread_dir pthread COMPONENT_DIR)
6069idf_component_get_property(pthread_include_dirs pthread INCLUDE_DIRS)
6170idf_component_get_property(pthread_srcs pthread SRCS)
0 commit comments