11include (CMakeForceCompiler )
22
33set (CMAKE_SYSTEM_NAME Generic)
4- set (CMAKE_SYSTEM_PROCESSOR xtensa)
4+
5+ set (idf_target "@IDF_TARGET@" )
6+
7+ if ("${idf_target} " STREQUAL "esp32c3" )
8+ set (CMAKE_SYSTEM_PROCESSOR riscv)
9+ else ()
10+ set (CMAKE_SYSTEM_PROCESSOR xtensa)
11+ endif ()
12+
513set (CMAKE_CROSSCOMPILING 1)
614set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
715set (PLATFORM_NAME "LwIP" )
@@ -24,7 +32,7 @@ add_definitions(-DLWIP_IPV4 -DLWIP_IPV6)
2432include_directories (
2533 "@BUILD_CONFIG_DIR@"
2634 ${idf_path} /components/soc/soc/include
27- ${idf_path} /components/freertos/port/xtensa /include
35+ ${idf_path} /components/freertos/port/${CMAKE_SYSTEM_PROCESSOR} /include
2836 ${idf_path} /components/hal/${idf_target}/include
2937 ${idf_path} /components/hal/include
3038 ${idf_path} /components/esp_hw_support/include
@@ -40,7 +48,7 @@ include_directories(
4048 ${idf_path} /components/vfs/include
4149 ${idf_path} /components/log/include
4250 ${idf_path} /components/freertos/include
43- ${idf_path} /components/freertos/xtensa /include
51+ ${idf_path} /components/freertos/${CMAKE_SYSTEM_PROCESSOR} /include
4452 ${idf_path} /components/soc/soc/${idf_target}/include
4553 ${idf_path} /components/wifi_provisioning/include
4654 ${idf_path} /components/pthread/include
@@ -60,8 +68,8 @@ include_directories(
6068 ${idf_path} /components/efuse/include
6169 ${idf_path} /components/mbedtls/port/include
6270 ${idf_path} /components/mbedtls/mbedtls/include
63- ${idf_path} /components/xtensa /${idf_target}/include
64- ${idf_path} /components/xtensa /include
71+ ${idf_path} /components/${CMAKE_SYSTEM_PROCESSOR} /${idf_target}/include
72+ ${idf_path} /components/${CMAKE_SYSTEM_PROCESSOR} /include
6573 ${idf_path} /components/app_trace/include
6674 ${idf_path} /components/nvs_flash/include
6775 ${idf_path} /components/jsmn/include
0 commit comments