6ee9ec7656
1. Update all CMakeLists.txt to adapt to new layout 2. Fix cmake build break 3. Update all new file license 4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose) ------------------ How to test From within nuttx/. Configure: cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja (or full path in custom board) : cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja This uses ninja generator (install with sudo apt install ninja-build). To build: $ cmake --build build menuconfig: $ cmake --build build -t menuconfig -------------------------- 2. cmake/build: reformat the cmake style by cmake-format https://github.com/cheshirekow/cmake_format $ pip install cmakelang $ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done $ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done Co-authored-by: Matias N <matias@protobits.dev> Signed-off-by: chao an <anchao@xiaomi.com>
173 lines
3.3 KiB
CMake
173 lines
3.3 KiB
CMake
# ##############################################################################
|
|
# drivers/power/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.
|
|
#
|
|
# ##############################################################################
|
|
|
|
# Include power management sources
|
|
|
|
set(SRCS)
|
|
|
|
if(CONFIG_PM)
|
|
|
|
list(
|
|
APPEND
|
|
SRCS
|
|
pm_initialize.c
|
|
pm_activity.c
|
|
pm_changestate.c
|
|
pm_checkstate.c
|
|
pm_register.c
|
|
pm_unregister.c
|
|
pm_autoupdate.c
|
|
pm_governor.c
|
|
pm_lock.c)
|
|
|
|
if(CONFIG_PM_PROCFS)
|
|
list(APPEND SRCS pm_procfs.c)
|
|
endif()
|
|
|
|
# Governor implementations
|
|
|
|
if(CONFIG_PM_GOVERNOR_ACTIVITY)
|
|
|
|
list(APPEND SRCS activity_governor.c)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_PM_GOVERNOR_GREEDY)
|
|
|
|
list(APPEND SRCS greedy_governor.c)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
# Add switched-mode power supply support
|
|
|
|
if(CONFIG_DRIVERS_SMPS)
|
|
|
|
list(APPEND SRCS smps.c)
|
|
|
|
endif()
|
|
|
|
# Add powerled support
|
|
|
|
if(CONFIG_DRIVERS_POWERLED)
|
|
|
|
list(APPEND SRCS powerled.c)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_REGULATOR)
|
|
|
|
list(APPEND SRCS regulator.c)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_REGULATOR_RPMSG)
|
|
|
|
list(APPEND SRCS regulator_rpmsg.c)
|
|
|
|
endif()
|
|
|
|
if(CONFIG_REGULATOR_GPIO)
|
|
|
|
list(APPEND SRCS regulator_gpio.c)
|
|
|
|
endif()
|
|
|
|
# Add battery charger drivers
|
|
|
|
if(CONFIG_BATTERY_CHARGER)
|
|
|
|
list(APPEND SRCS battery_charger.c)
|
|
|
|
# Add the MCP73871 battery charger driver
|
|
|
|
if(CONFIG_MCP73871)
|
|
list(APPEND SRCS mcp73871.c)
|
|
endif()
|
|
|
|
# Add I2C-based battery charger drivers
|
|
|
|
if(CONFIG_I2C)
|
|
|
|
# Add the BQ2425x I2C-based battery charger driver
|
|
|
|
if(CONFIG_I2C_BQ2425X)
|
|
list(APPEND SRCS bq2425x.c)
|
|
endif()
|
|
|
|
# Add the BQ2429x I2C-based battery charger driver
|
|
|
|
if(CONFIG_I2C_BQ2429X)
|
|
list(APPEND SRCS bq2429x.c)
|
|
endif()
|
|
|
|
# Add the axp202 I2C-based battery charger driver
|
|
|
|
if(CONFIG_I2C_AXP202)
|
|
list(APPEND SRCS axp202.c)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
# Add battery gauge drivers
|
|
|
|
if(CONFIG_BATTERY_GAUGE)
|
|
|
|
list(APPEND SRCS battery_gauge.c)
|
|
|
|
# Add I2C-based battery gauge drivers
|
|
|
|
if(CONFIG_I2C)
|
|
|
|
# Add the MAX1704x I2C-based battery gauge driver
|
|
|
|
if(CONFIG_I2C_MAX1704X)
|
|
list(APPEND SRCS max1704x.c)
|
|
endif()
|
|
|
|
# Add the bq27426 I2C-based battery gauge driver
|
|
|
|
if(CONFIG_BQ27426)
|
|
list(APPEND SRCS bq27426.c)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
# Add battery monitor drivers
|
|
|
|
if(CONFIG_BATTERY_MONITOR)
|
|
list(APPEND SRCS battery_monitor.c)
|
|
# Add I2C-based battery monitor drivers
|
|
|
|
if(CONFIG_I2C)
|
|
# Add the BQ769x0 I2C-based battery monitor driver
|
|
if(CONFIG_I2C_BQ769X0)
|
|
list(APPEND SRCS bq769x0.c)
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
target_sources(drivers PRIVATE ${SRCS})
|