From de7132c697af41e1236e443c297df99078c69486 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 10 Jul 2023 09:57:56 +0800 Subject: [PATCH] cmake/sched: fix build break based on mainline Signed-off-by: chao an --- CMakeLists.txt | 7 +++++++ libs/libc/modlib/CMakeLists.txt | 37 +++++++++++++++++++-------------- libs/libc/sched/CMakeLists.txt | 19 +++++++++++------ sched/clock/CMakeLists.txt | 9 +++++--- 4 files changed, 47 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01d6c6989f..632fc5e414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,13 @@ if(NOT DEFINED BOARD_CONFIG) message(FATAL_ERROR "Please define configuration with BOARD_CONFIG") endif() +find_program(KCONFIGLIB olddefconfig) +if(NOT KCONFIGLIB) + message( + FATAL_ERROR "Kconfig environment depends on kconfiglib, Please install: + $ pip install kconfiglib") +endif() + if(EXISTS ${BOARD_CONFIG} AND EXISTS ${BOARD_CONFIG}/defconfig) get_filename_component(NUTTX_BOARD_ABS_DIR ${BOARD_CONFIG} ABSOLUTE BASE_DIR ${NUTTX_DIR}) diff --git a/libs/libc/modlib/CMakeLists.txt b/libs/libc/modlib/CMakeLists.txt index 1e62937bef..741f37abf9 100644 --- a/libs/libc/modlib/CMakeLists.txt +++ b/libs/libc/modlib/CMakeLists.txt @@ -20,21 +20,26 @@ if(CONFIG_LIBC_MODLIB) - target_sources( - c - PRIVATE modlib_bind.c - modlib_depend.c - modlib_init.c - modlib_iobuffer.c - modlib_load.c - modlib_loadshdrs.c - modlib_read.c - modlib_registry.c - modlib_sections.c - modlib_symbols.c - modlib_symtab.c - modlib_uninit.c - modlib_unload.c - modlib_verify.c) + list( + APPEND + SRCS + modlib_bind.c + modlib_depend.c + modlib_init.c + modlib_iobuffer.c + modlib_load.c + modlib_loadhdrs.c + modlib_read.c + modlib_registry.c + modlib_sections.c + modlib_symbols.c + modlib_symtab.c + modlib_uninit.c + modlib_unload.c + modlib_verify.c) + + list(APPEND SRCS modlib_globals.S) + + target_sources(c PRIVATE ${SRCS}) endif() diff --git a/libs/libc/sched/CMakeLists.txt b/libs/libc/sched/CMakeLists.txt index a60c0e2990..fd4630c2a8 100644 --- a/libs/libc/sched/CMakeLists.txt +++ b/libs/libc/sched/CMakeLists.txt @@ -18,8 +18,15 @@ # # ############################################################################## -set(SRCS sched_getprioritymax.c sched_getprioritymin.c clock_ticks2time.c - clock_time2ticks.c clock_timespec_add.c clock_timespec_subtract.c) +set(SRCS + sched_getprioritymax.c + sched_getprioritymin.c + clock_ticks2time.c + clock_time2ticks.c + clock_timespec_add.c + clock_timespec_subtract.c + clock_getcpuclockid.c + clock_getres.c) if(NOT CONFIG_CANCELLATION_POINTS) list(APPEND SRCS task_setcanceltype.c task_testcancel.c) @@ -29,12 +36,12 @@ if(CONFIG_SMP) list(APPEND SRCS sched_cpucount.c) endif() +if(CONFIG_SCHED_BACKTRACE) + list(APPEND SRCS sched_dumpstack.c sched_backtrace.c) +endif() + if(NOT CONFIG_BUILD_KERNEL) list(APPEND SRCS task_startup.c) - - if(CONFIG_SCHED_BACKTRACE) - list(APPEND SRCS sched_dumpstack.c sched_backtrace.c) - endif() endif() target_sources(c PRIVATE ${SRCS}) diff --git a/sched/clock/CMakeLists.txt b/sched/clock/CMakeLists.txt index 6a9a712221..3e74d43a80 100644 --- a/sched/clock/CMakeLists.txt +++ b/sched/clock/CMakeLists.txt @@ -24,16 +24,19 @@ if(CONFIG_CLOCK_TIMEKEEPING) list(APPEND SRCS clock_timekeeping.c) endif() +if(CONFIG_CLOCK_ADJTIME) + list(APPEND SRCS clock_adjtime.c) +endif() + list( APPEND SRCS + clock.c clock_initialize.c clock_settime.c clock_gettime.c - clock_getres.c clock_abstime2ticks.c clock_systime_ticks.c - clock_systime_timespec.c - clock.c) + clock_systime_timespec.c) target_sources(sched PRIVATE ${SRCS})