From f2f0d7fbad13bd898d54ec136a0d9e7e908c6af0 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Wed, 16 Aug 2023 12:18:58 +0800 Subject: [PATCH] cmake:fix drivers build block during cmake reforming Signed-off-by: xuxin19 --- binfmt/CMakeLists.txt | 4 +++ drivers/audio/CMakeLists.txt | 17 +++++++++++ drivers/input/CMakeLists.txt | 4 +++ drivers/ioexpander/CMakeLists.txt | 7 +++++ drivers/ipcc/CMakeLists.txt | 32 ++++++++++++++++++++ drivers/lcd/CMakeLists.txt | 3 ++ drivers/leds/CMakeLists.txt | 4 +++ drivers/modem/alt1250/CMakeLists.txt | 45 ++++++++++++++++++++++++++++ drivers/motor/CMakeLists.txt | 8 ++++- drivers/serial/CMakeLists.txt | 4 +++ drivers/timers/CMakeLists.txt | 12 ++++++++ drivers/usbdev/CMakeLists.txt | 4 +-- drivers/usbmisc/CMakeLists.txt | 4 +++ drivers/video/CMakeLists.txt | 7 +++++ drivers/video/mipidsi/CMakeLists.txt | 29 ++++++++++++++++++ 15 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 drivers/ipcc/CMakeLists.txt create mode 100644 drivers/modem/alt1250/CMakeLists.txt create mode 100644 drivers/video/mipidsi/CMakeLists.txt diff --git a/binfmt/CMakeLists.txt b/binfmt/CMakeLists.txt index c66615b6202..f0e0abe3713 100644 --- a/binfmt/CMakeLists.txt +++ b/binfmt/CMakeLists.txt @@ -51,6 +51,10 @@ if(CONFIG_ELF) list(APPEND SRCS elf.c) endif() +if(CONFIG_NXFLAT) + list(APPEND SRCS nxflat.c) +endif() + # Builtin application interfaces if(CONFIG_BUILTIN) diff --git a/drivers/audio/CMakeLists.txt b/drivers/audio/CMakeLists.txt index b4929abe630..012a5b7e5c6 100644 --- a/drivers/audio/CMakeLists.txt +++ b/drivers/audio/CMakeLists.txt @@ -48,6 +48,20 @@ if(CONFIG_DRIVERS_AUDIO) list(APPEND SRCS cs4344.c) endif() + if(CONFIG_AUDIO_ES8311) + list(APPEND SRCS es8311.c) + if(CONFIG_ES8311_REGDUMP) + list(APPEND SRCS es8311_debug.c) + endif() + endif() + + if(CONFIG_AUDIO_ES8388) + list(APPEND SRCS es8388.c) + if(CONFIG_ES8388_REGDUMP) + list(APPEND SRCS es8388_debug.c) + endif() + endif() + if(CONFIG_AUDIO_WM8994) list(APPEND SRCS wm8994.c) @@ -84,5 +98,8 @@ if(CONFIG_DRIVERS_AUDIO) list(APPEND SRCS audio_i2s.c) endif() + if(CONFIG_AUDIO_DMA) + list(APPEND SRCS audio_dma.c) + endif() target_sources(drivers PRIVATE ${SRCS}) endif() diff --git a/drivers/input/CMakeLists.txt b/drivers/input/CMakeLists.txt index d103007752e..dc079de9766 100644 --- a/drivers/input/CMakeLists.txt +++ b/drivers/input/CMakeLists.txt @@ -76,6 +76,10 @@ if(CONFIG_INPUT) list(APPEND SRCS cypress_mbr3108.c) endif() + if(CONFIG_INPUT_GT9XX) + list(APPEND SRCS gt9xx.c) + endif() + if(CONFIG_INPUT_BUTTONS) list(APPEND SRCS button_upper.c) diff --git a/drivers/ioexpander/CMakeLists.txt b/drivers/ioexpander/CMakeLists.txt index df92f8c196c..2274811abe6 100644 --- a/drivers/ioexpander/CMakeLists.txt +++ b/drivers/ioexpander/CMakeLists.txt @@ -50,10 +50,17 @@ if(CONFIG_IOEXPANDER) list(APPEND SRCS pcf8574.c) endif() + if(CONFIG_IOEXPANDER_PCF8575) + list(APPEND SRCS pcf8575.c) + endif() + if(CONFIG_IOEXPANDER_MCP23X17) list(APPEND SRCS mcp23x17.c) endif() + if(CONFIG_IOEXPANDER_SX1509) + list(APPEND SRCS sx1509.c) + endif() endif() # GPIO test device driver (independent of IOEXPANDERS) diff --git a/drivers/ipcc/CMakeLists.txt b/drivers/ipcc/CMakeLists.txt new file mode 100644 index 00000000000..54d128b2ecc --- /dev/null +++ b/drivers/ipcc/CMakeLists.txt @@ -0,0 +1,32 @@ +# ############################################################################## +# drivers/ipcc/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_IPCC) + + set(SRCS ipcc_poll.c ipcc_read.c ipcc_write.c ipcc_register.c ipcc_open.c + ipcc_close.c) + + if(NOT CONFIG_DISABLE_PSEUDOFS_OPERATIONS) + list(APPEND SRCS ipcc_unlink.c) + endif() + + target_sources(drivers PRIVATE ${SRCS}) + +endif() diff --git a/drivers/lcd/CMakeLists.txt b/drivers/lcd/CMakeLists.txt index 937e5440a0f..5c4311be521 100644 --- a/drivers/lcd/CMakeLists.txt +++ b/drivers/lcd/CMakeLists.txt @@ -147,6 +147,9 @@ if(CONFIG_LCD) list(APPEND SRCS gc9a01.c) endif() + if(CONFIG_LCD_JD9851) + list(APPEND SRCS jd9851.c) + endif() endif() # CONFIG_LCD if(CONFIG_SLCD) diff --git a/drivers/leds/CMakeLists.txt b/drivers/leds/CMakeLists.txt index 23ea9f4c29f..432d6c364ce 100644 --- a/drivers/leds/CMakeLists.txt +++ b/drivers/leds/CMakeLists.txt @@ -41,6 +41,10 @@ if(CONFIG_RGBLED) list(APPEND SRCS rgbled.c) endif() +if(CONFIG_LP503X) + list(APPEND SRCS lp503x.c) +endif() + if(CONFIG_PCA9635PW) list(APPEND SRCS pca9635pw.c) endif() diff --git a/drivers/modem/alt1250/CMakeLists.txt b/drivers/modem/alt1250/CMakeLists.txt new file mode 100644 index 00000000000..519d51b59b4 --- /dev/null +++ b/drivers/modem/alt1250/CMakeLists.txt @@ -0,0 +1,45 @@ +# ############################################################################## +# drivers/modem/alt1250/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_MODEM_ALT1250) + set(SRCS + alt1250.c + altcom_pkt.c + altcom_hdlr.c + altcom_hdlr_pdn.c + altcom_hdlr_radio.c + altcom_hdlr_net.c + altcom_hdlr_psave.c + altcom_hdlr_sim.c + altcom_hdlr_pin.c + altcom_hdlr_socket.c + altcom_hdlr_sms.c + altcom_hdlr_firmware.c + altcom_hdlr_log.c + altcom_hdlr_other.c + altcom_lwm2m_hdlr.c + altcom_errno.c + altmdm.c + altmdm_event.c + altmdm_spi.c + altmdm_timer.c) + + target_sources(drivers PRIVATE ${SRCS}) +endif() diff --git a/drivers/motor/CMakeLists.txt b/drivers/motor/CMakeLists.txt index 8c1ab18fbe6..affaad616ee 100644 --- a/drivers/motor/CMakeLists.txt +++ b/drivers/motor/CMakeLists.txt @@ -17,4 +17,10 @@ # the License. # # ############################################################################## -nuttx_add_subdirectory() +if(CONFIG_MOTOR_FOC) + nuttx_add_subdirectory() +endif() + +if(CONFIG_MOTOR_UPPER) + target_sources(drivers PRIVATE motor.c) +endif() diff --git a/drivers/serial/CMakeLists.txt b/drivers/serial/CMakeLists.txt index 87ca6ea8dae..1dffcd4f08f 100644 --- a/drivers/serial/CMakeLists.txt +++ b/drivers/serial/CMakeLists.txt @@ -22,6 +22,10 @@ set(SRCS serial.c serial_io.c) +if(CONFIG_UART_PL011) + list(APPEND SRCS serial_pl011.c) +endif() + if(CONFIG_SERIAL_RXDMA) list(APPEND SRCS serial_dma.c) elseif(CONFIG_SERIAL_TXDMA) diff --git a/drivers/timers/CMakeLists.txt b/drivers/timers/CMakeLists.txt index 0f9e7ebbedf..371f1f8e599 100644 --- a/drivers/timers/CMakeLists.txt +++ b/drivers/timers/CMakeLists.txt @@ -49,10 +49,18 @@ if(CONFIG_RTC_PCF85263) list(APPEND SRCS pcf85263.c) endif() +if(CONFIG_RTC_PL031) + list(APPEND SRCS pl031.c) +endif() + if(CONFIG_RTC_MCP794XX) list(APPEND SRCS mcp794xx.c) endif() +if(CONFIG_RTC_RX8010SJ) + list(APPEND SRCS rx8010.c) +endif() + if(CONFIG_RTC_RPMSG) list(APPEND SRCS rpmsg_rtc.c) endif() @@ -73,4 +81,8 @@ if(CONFIG_PWM) list(APPEND SRCS pwm.c) endif() +if(CONFIG_CAPTURE) + list(APPEND SRCS capture.c) +endif() + target_sources(drivers PRIVATE ${SRCS}) diff --git a/drivers/usbdev/CMakeLists.txt b/drivers/usbdev/CMakeLists.txt index c5c55bcfaca..579168cd7df 100644 --- a/drivers/usbdev/CMakeLists.txt +++ b/drivers/usbdev/CMakeLists.txt @@ -36,7 +36,7 @@ if(CONFIG_USBDEV) endif() if(CONFIG_USBDEV_COMPOSITE) - list(APPEND SRCS composite.c composite_desc.c) + list(APPEND SRCS composite_desc.c) endif() if(CONFIG_USBDEV_TRACE_STRINGS) @@ -59,7 +59,7 @@ if(CONFIG_USBDEV) list(APPEND SRCS cdcecm.c) endif() - list(APPEND SRCS usbdev_req.c usbdev_trace.c usbdev_trprintf.c) + list(APPEND SRCS composite.c usbdev_req.c usbdev_trace.c usbdev_trprintf.c) target_sources(drivers PRIVATE ${SRCS}) endif() diff --git a/drivers/usbmisc/CMakeLists.txt b/drivers/usbmisc/CMakeLists.txt index 15d55418294..6365366150e 100644 --- a/drivers/usbmisc/CMakeLists.txt +++ b/drivers/usbmisc/CMakeLists.txt @@ -27,6 +27,10 @@ if(CONFIG_USBMISC) list(APPEND SRCS fusb301.c) endif() + if(CONFIG_FUSB302) + list(APPEND SRCS fusb302.c) + endif() + if(CONFIG_FUSB303) list(APPEND SRCS fusb303.c) endif() diff --git a/drivers/video/CMakeLists.txt b/drivers/video/CMakeLists.txt index a66b475998c..3462ba26e2f 100644 --- a/drivers/video/CMakeLists.txt +++ b/drivers/video/CMakeLists.txt @@ -50,6 +50,13 @@ if(CONFIG_DRIVERS_VIDEO) endif() + if(CONFIG_GOLDFISH_FB) + list(APPEND SRCS goldfish_fb.c) + endif() + + if(CONFIG_GOLDFISH_CAMERA) + list(APPEND SRCS goldfish_camera.c) + endif() # These video drivers depend on SPI support if(CONFIG_SPI) diff --git a/drivers/video/mipidsi/CMakeLists.txt b/drivers/video/mipidsi/CMakeLists.txt new file mode 100644 index 00000000000..22d32ab0edf --- /dev/null +++ b/drivers/video/mipidsi/CMakeLists.txt @@ -0,0 +1,29 @@ +# ############################################################################## +# drivers/video/mipidsi/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_MIPI_DSI) + set(SRCS mipi_dsi_device.c mipi_dsi_host.c mipi_dsi_packet.c) + + if(CONFIG_MIPI_DSI_DRIVER) + list(APPEND SRCS mipi_dsi_device_driver.c mipi_dsi_host_driver.c) + endif() + + target_sources(drivers PRIVATE ${SRCS}) +endif()