This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e65658cf8fca49018d511042e06beb59ce148248
Author: Arjav Patel <[email protected]>
AuthorDate: Fri May 1 02:19:09 2026 +0530

    boards/xtensa/espressif: Add CMake wiring for representative ESP32 boards.
    
    Introduce common and board-level CMakeLists for esp32-devkitc,
    esp32s2-saola-1, and esp32s3-devkit so the new Xtensa arch CMake paths
    are reachable through board builds.
    
    Signed-off-by: Arjav Patel <[email protected]>
---
 boards/xtensa/esp32/common/CMakeLists.txt          |  8 +++++
 boards/xtensa/esp32/common/src/CMakeLists.txt      | 36 ++++++++++++++++++++++
 boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt   | 11 +++++++
 .../xtensa/esp32/esp32-devkitc/src/CMakeLists.txt  | 24 +++++++++++++++
 boards/xtensa/esp32s2/common/CMakeLists.txt        |  8 +++++
 boards/xtensa/esp32s2/common/src/CMakeLists.txt    | 27 ++++++++++++++++
 .../xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt  | 11 +++++++
 .../esp32s2/esp32s2-saola-1/src/CMakeLists.txt     | 20 ++++++++++++
 boards/xtensa/esp32s3/common/CMakeLists.txt        |  8 +++++
 boards/xtensa/esp32s3/common/src/CMakeLists.txt    | 24 +++++++++++++++
 .../xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt   | 11 +++++++
 .../esp32s3/esp32s3-devkit/src/CMakeLists.txt      | 24 +++++++++++++++
 12 files changed, 212 insertions(+)

diff --git a/boards/xtensa/esp32/common/CMakeLists.txt 
b/boards/xtensa/esp32/common/CMakeLists.txt
new file mode 100644
index 00000000000..ba878244faa
--- /dev/null
+++ b/boards/xtensa/esp32/common/CMakeLists.txt
@@ -0,0 +1,8 @@
+# 
##############################################################################
+# boards/xtensa/esp32/common/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+add_subdirectory(src)
+target_include_directories(board PRIVATE include)
diff --git a/boards/xtensa/esp32/common/src/CMakeLists.txt 
b/boards/xtensa/esp32/common/src/CMakeLists.txt
new file mode 100644
index 00000000000..5985ba3c4db
--- /dev/null
+++ b/boards/xtensa/esp32/common/src/CMakeLists.txt
@@ -0,0 +1,36 @@
+# 
##############################################################################
+# boards/xtensa/esp32/common/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS)
+
+if(CONFIG_ARCH_BOARD_COMMON)
+  if(CONFIG_WATCHDOG)
+    list(APPEND SRCS esp32_board_wdt.c)
+  endif()
+  if(CONFIG_ESPRESSIF_ADC)
+    list(APPEND SRCS esp32_board_adc.c)
+  endif()
+  if(CONFIG_ESP32_I2C)
+    list(APPEND SRCS esp32_board_i2c.c)
+  endif()
+  if(CONFIG_ESP32_SPI)
+    list(APPEND SRCS esp32_board_spi.c)
+  endif()
+  if(CONFIG_SPI_DRIVER)
+    list(APPEND SRCS esp32_board_spidev.c)
+  endif()
+  if(CONFIG_SPI_SLAVE_DRIVER)
+    list(APPEND SRCS esp32_board_spislavedev.c)
+  endif()
+  if(CONFIG_ESP32_SPIFLASH)
+    list(APPEND SRCS esp32_board_spiflash.c)
+  endif()
+  if(CONFIG_ESPRESSIF_WIFI)
+    list(APPEND SRCS esp32_board_wlan.c)
+  endif()
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt 
b/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
new file mode 100644
index 00000000000..f7e48d6342f
--- /dev/null
+++ b/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 
##############################################################################
+# boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../common/CMakeLists.txt")
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common common)
+endif()
+
+add_subdirectory(src)
diff --git a/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt 
b/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
new file mode 100644
index 00000000000..60d286b03dc
--- /dev/null
+++ b/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+# 
##############################################################################
+# boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS esp32_boot.c esp32_bringup.c)
+
+if(CONFIG_BOARDCTL)
+  list(APPEND SRCS esp32_appinit.c)
+  if(CONFIG_BOARDCTL_RESET)
+    list(APPEND SRCS esp32_reset.c)
+  endif()
+endif()
+
+if(CONFIG_DEV_GPIO)
+  list(APPEND SRCS esp32_gpio.c)
+endif()
+
+if(CONFIG_ARCH_BUTTONS)
+  list(APPEND SRCS esp32_buttons.c)
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s2/common/CMakeLists.txt 
b/boards/xtensa/esp32s2/common/CMakeLists.txt
new file mode 100644
index 00000000000..4322c68a229
--- /dev/null
+++ b/boards/xtensa/esp32s2/common/CMakeLists.txt
@@ -0,0 +1,8 @@
+# 
##############################################################################
+# boards/xtensa/esp32s2/common/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+add_subdirectory(src)
+target_include_directories(board PRIVATE include)
diff --git a/boards/xtensa/esp32s2/common/src/CMakeLists.txt 
b/boards/xtensa/esp32s2/common/src/CMakeLists.txt
new file mode 100644
index 00000000000..9ab6fe325b1
--- /dev/null
+++ b/boards/xtensa/esp32s2/common/src/CMakeLists.txt
@@ -0,0 +1,27 @@
+# 
##############################################################################
+# boards/xtensa/esp32s2/common/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS)
+
+if(CONFIG_ARCH_BOARD_COMMON)
+  if(CONFIG_ESPRESSIF_ADC)
+    list(APPEND SRCS esp32s2_board_adc.c)
+  endif()
+  if(CONFIG_WATCHDOG)
+    list(APPEND SRCS esp32s2_board_wdt.c)
+  endif()
+  if(CONFIG_ESP32S2_SPI)
+    list(APPEND SRCS esp32s2_board_spi.c)
+  endif()
+  if(CONFIG_SPI_DRIVER)
+    list(APPEND SRCS esp32s2_board_spidev.c)
+  endif()
+  if(CONFIG_SPI_SLAVE_DRIVER)
+    list(APPEND SRCS esp32s2_board_spislavedev.c)
+  endif()
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt 
b/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
new file mode 100644
index 00000000000..071f0a9f4b8
--- /dev/null
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 
##############################################################################
+# boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../common/CMakeLists.txt")
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common common)
+endif()
+
+add_subdirectory(src)
diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt 
b/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
new file mode 100644
index 00000000000..156c0b6e146
--- /dev/null
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
@@ -0,0 +1,20 @@
+# 
##############################################################################
+# boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS esp32s2_boot.c esp32s2_bringup.c)
+
+if(CONFIG_BOARDCTL)
+  list(APPEND SRCS esp32s2_appinit.c)
+  if(CONFIG_BOARDCTL_RESET)
+    list(APPEND SRCS esp32s2_reset.c)
+  endif()
+endif()
+
+if(CONFIG_DEV_GPIO)
+  list(APPEND SRCS esp32s2_gpio.c)
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s3/common/CMakeLists.txt 
b/boards/xtensa/esp32s3/common/CMakeLists.txt
new file mode 100644
index 00000000000..4b97755ce5d
--- /dev/null
+++ b/boards/xtensa/esp32s3/common/CMakeLists.txt
@@ -0,0 +1,8 @@
+# 
##############################################################################
+# boards/xtensa/esp32s3/common/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+add_subdirectory(src)
+target_include_directories(board PRIVATE include)
diff --git a/boards/xtensa/esp32s3/common/src/CMakeLists.txt 
b/boards/xtensa/esp32s3/common/src/CMakeLists.txt
new file mode 100644
index 00000000000..83f39a59462
--- /dev/null
+++ b/boards/xtensa/esp32s3/common/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+# 
##############################################################################
+# boards/xtensa/esp32s3/common/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS)
+
+if(CONFIG_ARCH_BOARD_COMMON)
+  if(CONFIG_ESP32S3_TIMER)
+    list(APPEND SRCS esp32s3_board_tim.c)
+  endif()
+  if(CONFIG_WATCHDOG)
+    list(APPEND SRCS esp32s3_board_wdt.c)
+  endif()
+  if(CONFIG_ESP32S3_SPIFLASH)
+    list(APPEND SRCS esp32s3_board_spiflash.c)
+  endif()
+  if(CONFIG_SPI_DRIVER)
+    list(APPEND SRCS esp32s3_board_spidev.c)
+  endif()
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt 
b/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
new file mode 100644
index 00000000000..95faf689131
--- /dev/null
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 
##############################################################################
+# boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../common/CMakeLists.txt")
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common common)
+endif()
+
+add_subdirectory(src)
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt 
b/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
new file mode 100644
index 00000000000..2fd6058846d
--- /dev/null
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+# 
##############################################################################
+# boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS esp32s3_boot.c esp32s3_bringup.c)
+
+if(CONFIG_BOARDCTL)
+  list(APPEND SRCS esp32s3_appinit.c)
+  if(CONFIG_BOARDCTL_RESET)
+    list(APPEND SRCS esp32s3_reset.c)
+  endif()
+endif()
+
+if(CONFIG_DEV_GPIO)
+  list(APPEND SRCS esp32s3_gpio.c)
+endif()
+
+if(CONFIG_ARCH_BUTTONS)
+  list(APPEND SRCS esp32s3_buttons.c)
+endif()
+
+target_sources(board PRIVATE ${SRCS})

Reply via email to