xiaoxiang781216 commented on code in PR #21047:
URL: https://github.com/apache/nuttx/pull/21047#discussion_r4419652963


##########
drivers/serial/Make.defs:
##########
@@ -99,3 +100,4 @@ endif
 
 DEPPATH += --dep-path serial
 VPATH += :serial
+endif

Review Comment:
   why not move to line 27



##########
drivers/serial/CMakeLists.txt:
##########
@@ -22,77 +22,79 @@
 
 # Include serial drivers
 
-set(SRCS serial.c serial_io.c)
+if(CONFIG_SERIAL)
+  set(SRCS serial.c serial_io.c)
 
-if(CONFIG_SERIAL_GDBSTUB)
-  list(APPEND SRCS serial_gdbstub.c)
-endif()
+  if(CONFIG_SERIAL_GDBSTUB)
+    list(APPEND SRCS serial_gdbstub.c)
+  endif()
 
-if(CONFIG_CMSDK_UART)
-  list(APPEND SRCS serial_cmsdk.c)
-endif()
+  if(CONFIG_CMSDK_UART)
+    list(APPEND SRCS serial_cmsdk.c)
+  endif()
 
-if(CONFIG_SERIAL_RXDMA)
-  list(APPEND SRCS serial_dma.c)
-elseif(CONFIG_SERIAL_TXDMA)
-  list(APPEND SRCS serial_dma.c)
-endif()
+  if(CONFIG_SERIAL_RXDMA)
+    list(APPEND SRCS serial_dma.c)
+  elseif(CONFIG_SERIAL_TXDMA)
+    list(APPEND SRCS serial_dma.c)
+  endif()
 
-if(CONFIG_16550_UART)
-  list(APPEND SRCS uart_16550.c)
-endif()
+  if(CONFIG_16550_UART)
+    list(APPEND SRCS uart_16550.c)
+  endif()
 
-if(CONFIG_UART_PL011)
-  list(APPEND SRCS uart_pl011.c)
-endif()
+  if(CONFIG_UART_PL011)
+    list(APPEND SRCS uart_pl011.c)
+  endif()
 
-if(CONFIG_UART_XLNXPS)
-  list(APPEND SRCS uart_xlnx_ps.c)
-endif()
+  if(CONFIG_UART_XLNXPS)
+    list(APPEND SRCS uart_xlnx_ps.c)
+  endif()
 
-if(CONFIG_RPMSG_UART)
-  list(APPEND SRCS uart_rpmsg.c)
-endif()
+  if(CONFIG_RPMSG_UART)
+    list(APPEND SRCS uart_rpmsg.c)
+  endif()
 
-if(CONFIG_RPMSG_UART_RAW)
-  list(APPEND SRCS uart_rpmsg_raw.c)
-endif()
+  if(CONFIG_RPMSG_UART_RAW)
+    list(APPEND SRCS uart_rpmsg_raw.c)
+  endif()
 
-if(CONFIG_UART_HOSTFS)
-  list(APPEND SRCS uart_hostfs.c)
-endif()
+  if(CONFIG_UART_HOSTFS)
+    list(APPEND SRCS uart_hostfs.c)
+  endif()
 
-# Pseudo-terminal support
+  # Pseudo-terminal support
 
-if(CONFIG_PSEUDOTERM)
-  list(APPEND SRCS pty.c)
-  if(CONFIG_PSEUDOTERM_SUSV1)
-    list(APPEND SRCS ptmx.c)
+  if(CONFIG_PSEUDOTERM)
+    list(APPEND SRCS pty.c)
+    if(CONFIG_PSEUDOTERM_SUSV1)
+      list(APPEND SRCS ptmx.c)
+    endif()
   endif()
-endif()
 
-# Bluetooth H:4 UART driver
+  # Bluetooth H:4 UART driver
 
-if(CONFIG_UART_BTH4)
-  list(APPEND SRCS uart_bth4.c)
-endif()
+  if(CONFIG_UART_BTH4)
+    list(APPEND SRCS uart_bth4.c)
+  endif()
 
-# UART PCI drivers
+  # UART PCI drivers
 
-if(CONFIG_16550_PCI_UART)
-  list(APPEND SRCS uart_pci_16550.c)
-endif()
+  if(CONFIG_16550_PCI_UART)
+    list(APPEND SRCS uart_pci_16550.c)
+  endif()
 
-# Bluetooth H:5 UART driver
+  # Bluetooth H:5 UART driver
 
-if(CONFIG_UART_BTH5)
-  list(APPEND SRCS uart_bth5.c)
-endif()
+  if(CONFIG_UART_BTH5)
+    list(APPEND SRCS uart_bth5.c)
+  endif()
 
-# RAM uart support
+  # RAM uart support
 
-if(CONFIG_RAM_UART)
-  list(APPEND SRCS uart_ram.c)
-endif()
+  if(CONFIG_RAM_UART)
+    list(APPEND SRCS uart_ram.c)
+  endif()
 
-target_sources(drivers PRIVATE ${SRCS})
+  target_sources(drivers PRIVATE ${SRCS})
+endif()

Review Comment:
   why not move endif to line 27 and revert other change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to