mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 04:21:36 +08:00
cmake remove circular linking and reorganize
- px4_add_module now requires MAIN - px4_add_library doesn't automatically link
This commit is contained in:
@@ -39,17 +39,11 @@ if (NOT "${OS}" MATCHES "qurt")
|
||||
)
|
||||
endif()
|
||||
|
||||
px4_add_module(
|
||||
MODULE platforms__common
|
||||
SRCS
|
||||
module.cpp
|
||||
px4_getopt.c
|
||||
shutdown.cpp
|
||||
${SRCS}
|
||||
DEPENDS
|
||||
prebuild_targets
|
||||
uorb_headers
|
||||
uorb_msgs
|
||||
px4_add_library(platforms__common
|
||||
module.cpp
|
||||
px4_getopt.c
|
||||
shutdown.cpp
|
||||
${SRCS}
|
||||
)
|
||||
|
||||
add_subdirectory(work_queue)
|
||||
|
||||
@@ -61,7 +61,9 @@ void px4_log_initialize(void)
|
||||
log_message.severity = 6; //info
|
||||
strcpy((char *)log_message.text, "initialized uORB logging");
|
||||
|
||||
#if !defined(PARAM_NO_ORB)
|
||||
orb_log_message_pub = orb_advertise_queue(ORB_ID(log_message), &log_message, 2);
|
||||
#endif /* !PARAM_NO_ORB */
|
||||
|
||||
if (!orb_log_message_pub) {
|
||||
PX4_ERR("failed to advertise log_message");
|
||||
@@ -127,6 +129,8 @@ __EXPORT void px4_log_modulename(int level, const char *moduleName, const char *
|
||||
va_end(argptr);
|
||||
log_message.text[max_length - 1] = 0; //ensure 0-termination
|
||||
|
||||
#if !defined(PARAM_NO_ORB)
|
||||
orb_publish(ORB_ID(log_message), orb_log_message_pub, &log_message);
|
||||
#endif /* !PARAM_NO_ORB */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,25 +33,23 @@
|
||||
|
||||
# nuttx uses internal work queue currently
|
||||
if (NOT "${OS}" MATCHES "nuttx")
|
||||
px4_add_module(
|
||||
MODULE platforms__posix__work_queue
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
hrt_thread.c
|
||||
hrt_queue.c
|
||||
hrt_work_cancel.c
|
||||
work_thread.c
|
||||
work_lock.c
|
||||
work_queue.c
|
||||
work_cancel.c
|
||||
queue.c
|
||||
dq_addlast.c
|
||||
dq_remfirst.c
|
||||
sq_addlast.c
|
||||
sq_remfirst.c
|
||||
sq_addafter.c
|
||||
dq_rem.c
|
||||
DEPENDS
|
||||
platforms__common
|
||||
)
|
||||
|
||||
add_library(work_queue
|
||||
dq_addlast.c
|
||||
dq_rem.c
|
||||
dq_remfirst.c
|
||||
hrt_queue.c
|
||||
hrt_thread.c
|
||||
hrt_work_cancel.c
|
||||
queue.c
|
||||
sq_addafter.c
|
||||
sq_addlast.c
|
||||
sq_remfirst.c
|
||||
work_cancel.c
|
||||
work_lock.c
|
||||
work_queue.c
|
||||
work_thread.c
|
||||
)
|
||||
add_dependencies(work_queue prebuild_targets)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -38,6 +38,4 @@ px4_add_module(
|
||||
wqueue_start_posix.cpp
|
||||
wqueue_test.cpp
|
||||
DEPENDS
|
||||
platforms__common
|
||||
)
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
|
||||
Reference in New Issue
Block a user