From d93d377257b61158f46d1e4b16e5b6cace63b34c Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Thu, 7 Sep 2023 14:37:59 +0800 Subject: [PATCH] cmake:complete missing changes during cmake reforming for sched Signed-off-by: xuxin19 --- sched/addrenv/CMakeLists.txt | 23 +++++++++++++ sched/clock/CMakeLists.txt | 20 +++++------- sched/group/CMakeLists.txt | 12 ++++++- sched/irq/CMakeLists.txt | 5 +-- sched/misc/CMakeLists.txt | 9 ++++- sched/module/CMakeLists.txt | 4 +-- sched/pthread/CMakeLists.txt | 51 ++++++++++++++--------------- sched/semaphore/CMakeLists.txt | 29 +++++++--------- sched/signal/CMakeLists.txt | 60 ++++++++++++++++------------------ sched/task/CMakeLists.txt | 48 ++++++++++++--------------- sched/wqueue/CMakeLists.txt | 3 +- 11 files changed, 138 insertions(+), 126 deletions(-) create mode 100644 sched/addrenv/CMakeLists.txt diff --git a/sched/addrenv/CMakeLists.txt b/sched/addrenv/CMakeLists.txt new file mode 100644 index 0000000000..190eaf23bd --- /dev/null +++ b/sched/addrenv/CMakeLists.txt @@ -0,0 +1,23 @@ +# ############################################################################## +# sched/addrenv/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_ARCH_ADDRENV) + target_sources(sched PRIVATE addrenv.c) +endif() diff --git a/sched/clock/CMakeLists.txt b/sched/clock/CMakeLists.txt index 3e74d43a80..1547a6f410 100644 --- a/sched/clock/CMakeLists.txt +++ b/sched/clock/CMakeLists.txt @@ -18,7 +18,14 @@ # # ############################################################################## -set(SRCS) +set(SRCS + clock.c + clock_initialize.c + clock_settime.c + clock_gettime.c + clock_abstime2ticks.c + clock_systime_ticks.c + clock_systime_timespec.c) if(CONFIG_CLOCK_TIMEKEEPING) list(APPEND SRCS clock_timekeeping.c) @@ -28,15 +35,4 @@ 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_abstime2ticks.c - clock_systime_ticks.c - clock_systime_timespec.c) - target_sources(sched PRIVATE ${SRCS}) diff --git a/sched/group/CMakeLists.txt b/sched/group/CMakeLists.txt index e9958ad24b..dd3fced7f8 100644 --- a/sched/group/CMakeLists.txt +++ b/sched/group/CMakeLists.txt @@ -40,7 +40,17 @@ elseif(CONFIG_SCHED_WAITPID) endif() if(CONFIG_SCHED_USER_IDENTITY) - list(APPEND SRCS group_setuid.c group_setgid.c group_getuid.c group_getgid.c) + list( + APPEND + SRCS + group_setuid.c + group_setgid.c + group_getuid.c + group_getgid.c + group_seteuid.c + group_setegid.c + group_geteuid.c + group_getegid.c) endif() if(CONFIG_SIG_SIGSTOP_ACTION) diff --git a/sched/irq/CMakeLists.txt b/sched/irq/CMakeLists.txt index 00e362950e..a1d9f77b27 100644 --- a/sched/irq/CMakeLists.txt +++ b/sched/irq/CMakeLists.txt @@ -18,7 +18,7 @@ # # ############################################################################## -set(SRCS) +set(SRCS irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c) if(CONFIG_SMP) list(APPEND SRCS irq_spinlock.c) @@ -39,7 +39,4 @@ if(CONFIG_IRQCHAIN) list(APPEND SRCS irq_chain.c) endif() -list(APPEND SRCS irq_initialize.c irq_attach.c irq_dispatch.c - irq_unexpectedisr.c) - target_sources(sched PRIVATE ${SRCS}) diff --git a/sched/misc/CMakeLists.txt b/sched/misc/CMakeLists.txt index 86120f08ac..66f7927905 100644 --- a/sched/misc/CMakeLists.txt +++ b/sched/misc/CMakeLists.txt @@ -17,4 +17,11 @@ # the License. # # ############################################################################## -target_sources(sched PRIVATE assert.c panic_notifier.c reboot_notifier.c) + +set(SRCS assert.c panic_notifier.c reboot_notifier.c) + +if(CONFIG_ARCH_DEADLOCKDUMP) + list(APPEND SRCS deadlock.c) +endif() + +target_sources(sched PRIVATE ${SRCS}) diff --git a/sched/module/CMakeLists.txt b/sched/module/CMakeLists.txt index afa2c8f24f..36b252b714 100644 --- a/sched/module/CMakeLists.txt +++ b/sched/module/CMakeLists.txt @@ -19,13 +19,11 @@ # ############################################################################## if(CONFIG_MODULE) - set(SRCS) + set(SRCS mod_insmod.c mod_rmmod.c mod_modsym.c mod_modhandle.c) if(CONFIG_FS_PROCFS AND NOT CONFIG_FS_PROCFS_EXCLUDE_MODULE) list(APPEND SRCS mod_procfs.c) endif() - list(APPEND SRCS mod_insmod.c mod_rmmod.c mod_modsym.c mod_modhandle.c) - target_sources(sched PRIVATE ${SRCS}) endif() diff --git a/sched/pthread/CMakeLists.txt b/sched/pthread/CMakeLists.txt index 84b3517a81..3e6675145b 100644 --- a/sched/pthread/CMakeLists.txt +++ b/sched/pthread/CMakeLists.txt @@ -19,34 +19,31 @@ # ############################################################################## if(NOT CONFIG_DISABLE_PTHREAD) - set(SRCS) - list( - APPEND - SRCS - pthread_create.c - pthread_exit.c - pthread_join.c - pthread_detach.c - pthread_getschedparam.c - pthread_setschedparam.c - pthread_mutexinit.c - pthread_mutexdestroy.c - pthread_mutextimedlock.c - pthread_mutextrylock.c - pthread_mutexunlock.c - pthread_condwait.c - pthread_condsignal.c - pthread_condbroadcast.c - pthread_condclockwait.c - pthread_sigmask.c - pthread_cancel.c - pthread_initialize.c - pthread_completejoin.c - pthread_findjoininfo.c - pthread_release.c - pthread_setschedprio.c - pthread_barrierwait.c) + set(SRCS + pthread_create.c + pthread_exit.c + pthread_join.c + pthread_detach.c + pthread_getschedparam.c + pthread_setschedparam.c + pthread_mutexinit.c + pthread_mutexdestroy.c + pthread_mutextimedlock.c + pthread_mutextrylock.c + pthread_mutexunlock.c + pthread_condwait.c + pthread_condsignal.c + pthread_condbroadcast.c + pthread_condclockwait.c + pthread_sigmask.c + pthread_cancel.c + pthread_initialize.c + pthread_completejoin.c + pthread_findjoininfo.c + pthread_release.c + pthread_setschedprio.c + pthread_barrierwait.c) if(NOT CONFIG_PTHREAD_MUTEX_UNSAFE) list(APPEND SRCS pthread_mutex.c pthread_mutexconsistent.c diff --git a/sched/semaphore/CMakeLists.txt b/sched/semaphore/CMakeLists.txt index 8c74e0978a..cea7d21ac2 100644 --- a/sched/semaphore/CMakeLists.txt +++ b/sched/semaphore/CMakeLists.txt @@ -19,6 +19,18 @@ # ############################################################################## # Add semaphore-related files to the build +set(CSRCS + sem_destroy.c + sem_wait.c + sem_trywait.c + sem_tickwait.c + sem_timedwait.c + sem_clockwait.c + sem_timeout.c + sem_post.c + sem_recover.c + sem_reset.c + sem_waitirq.c) if(CONFIG_PRIORITY_INHERITANCE) list(APPEND CSRCS sem_initialize.c sem_holder.c sem_setprotocol.c) @@ -28,21 +40,4 @@ if(CONFIG_SPINLOCK) list(APPEND CSRCS spinlock.c) endif() -# Include semaphore build support - -list( - APPEND - CSRCS - sem_destroy.c - sem_wait.c - sem_trywait.c - sem_tickwait.c - sem_timedwait.c - sem_clockwait.c - sem_timeout.c - sem_post.c - sem_recover.c - sem_reset.c - sem_waitirq.c) - target_sources(sched PRIVATE ${CSRCS}) diff --git a/sched/signal/CMakeLists.txt b/sched/signal/CMakeLists.txt index bdee756dcf..de8a0fc98b 100644 --- a/sched/signal/CMakeLists.txt +++ b/sched/signal/CMakeLists.txt @@ -18,41 +18,37 @@ # # ############################################################################## -set(SRCS) +set(SRCS + sig_initialize.c + sig_action.c + sig_procmask.c + sig_pending.c + sig_suspend.c + sig_kill.c + sig_tgkill.c + sig_queue.c + sig_waitinfo.c + sig_timedwait.c + sig_findaction.c + sig_allocpendingsigaction.c + sig_releasependingsigaction.c + sig_unmaskpendingsignal.c + sig_removependingsignal.c + sig_releasependingsignal.c + sig_lowest.c + sig_notification.c + sig_cleanup.c + sig_dispatch.c + sig_deliver.c + sig_pause.c + sig_nanosleep.c + sig_usleep.c + sig_sleep.c + sig_ppoll.c + sig_pselect.c) if(CONFIG_SIG_DEFAULT) list(APPEND SRCS sig_default.c) endif() -list( - APPEND - SRCS - sig_initialize.c - sig_action.c - sig_procmask.c - sig_pending.c - sig_suspend.c - sig_kill.c - sig_tgkill.c - sig_queue.c - sig_waitinfo.c - sig_timedwait.c - sig_findaction.c - sig_allocpendingsigaction.c - sig_releasependingsigaction.c - sig_unmaskpendingsignal.c - sig_removependingsignal.c - sig_releasependingsignal.c - sig_lowest.c - sig_notification.c - sig_cleanup.c - sig_dispatch.c - sig_deliver.c - sig_pause.c - sig_nanosleep.c - sig_usleep.c - sig_sleep.c - sig_ppoll.c - sig_pselect.c) - target_sources(sched PRIVATE ${SRCS}) diff --git a/sched/task/CMakeLists.txt b/sched/task/CMakeLists.txt index 5f3f54e3ee..061a8c90cc 100644 --- a/sched/task/CMakeLists.txt +++ b/sched/task/CMakeLists.txt @@ -18,39 +18,33 @@ # # ############################################################################## -set(SRCS) - -list( - APPEND - SRCS - task_create.c - task_init.c - task_setup.c - task_activate.c - task_start.c - task_delete.c - task_exit.c - task_exithook.c - task_getgroup.c - task_getpid.c - task_prctl.c - task_recover.c - task_restart.c - task_spawnparms.c - task_setcancelstate.c - task_cancelpt.c - task_terminate.c - task_gettid.c - exit.c) +set(SRCS + task_create.c + task_init.c + task_setup.c + task_activate.c + task_start.c + task_delete.c + task_exit.c + task_exithook.c + task_getgroup.c + task_getpid.c + task_prctl.c + task_recover.c + task_restart.c + task_spawnparms.c + task_setcancelstate.c + task_cancelpt.c + task_terminate.c + task_gettid.c + exit.c) if(CONFIG_SCHED_HAVE_PARENT) list(APPEND SRCS task_getppid.c task_reparent.c) endif() if(CONFIG_ARCH_HAVE_FORK) - if(CONFIG_SCHED_WAITPID) - list(APPEND SRCS task_fork.c) - endif() + list(APPEND SRCS task_fork.c) endif() if(NOT CONFIG_BUILD_KERNEL) diff --git a/sched/wqueue/CMakeLists.txt b/sched/wqueue/CMakeLists.txt index 2ee1d9f186..58f6879ea6 100644 --- a/sched/wqueue/CMakeLists.txt +++ b/sched/wqueue/CMakeLists.txt @@ -21,9 +21,8 @@ # Add work queue files if(CONFIG_SCHED_WORKQUEUE) - set(SRCS) - list(APPEND SRCS kwork_queue.c kwork_cancel.c kwork_thread.c) + set(SRCS kwork_queue.c kwork_cancel.c kwork_thread.c) # Add low priority work queue files