cmake remove circular linking and reorganize

- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
This commit is contained in:
Daniel Agar
2018-04-29 21:48:54 -04:00
parent a8bc3d187f
commit ea3acb7121
576 changed files with 1406 additions and 2014 deletions
+5 -11
View File
@@ -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)
+4
View File
@@ -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 */
}
}
+19 -21
View File
@@ -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 :