From 1bcb93180b31c03789e59e3e71a260d5d3b607f6 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Mon, 16 Nov 2015 23:24:59 -0800 Subject: [PATCH] Set flags for building the proper DriverFramework target The DF_TARGET cmake variable needs to be set to (linux, darwin, qurt, nuttx) The define __DF_LINUX or __DF_QURT needs to be set. The __DF_DARWIN target is untested Signed-off-by: Mark Charlebois --- CMakeLists.txt | 14 ++++++++++++++ cmake/nuttx/px4_impl_nuttx.cmake | 1 + cmake/posix/px4_impl_posix.cmake | 2 ++ src/lib/DriverFramework | 2 +- src/lib/dspal | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f2e6dfdda..64c73efa67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,16 @@ list(GET config_args 1 BOARD) list(GET config_args 2 LABEL) set(target_name "${OS}-${BOARD}-${LABEL}") +if("${OS}" STREQUAL "posix") + if (APPLE) + set(DF_TARGET darwin) + else() + set(DF_TARGET linux) + endif() +else() + set(DF_TARGET ${OS}) +endif() + message(STATUS "${target_name}") # switch to ros CMake file if building ros @@ -327,6 +337,10 @@ endforeach() add_subdirectory(src/firmware/${OS}) add_subdirectory(src/lib/DriverFramework) +if("${OS}" STREQUAL "nuttx") + add_dependencies(df_driver_framework nuttx_export_${BOARD}) +endif() + if (config_io_board) add_subdirectory(src/modules/px4iofirmware) endif() diff --git a/cmake/nuttx/px4_impl_nuttx.cmake b/cmake/nuttx/px4_impl_nuttx.cmake index af7391f45c..14bd2ee3d6 100644 --- a/cmake/nuttx/px4_impl_nuttx.cmake +++ b/cmake/nuttx/px4_impl_nuttx.cmake @@ -429,6 +429,7 @@ function(px4_os_add_flags) ) set(added_definitions -D__PX4_NUTTX + -D__DF_NUTTX ) set(added_c_flags -nodefaultlibs diff --git a/cmake/posix/px4_impl_posix.cmake b/cmake/posix/px4_impl_posix.cmake index 28b27f87d1..ca6033448d 100644 --- a/cmake/posix/px4_impl_posix.cmake +++ b/cmake/posix/px4_impl_posix.cmake @@ -171,6 +171,7 @@ if(UNIX AND APPLE) set(added_definitions -D__PX4_POSIX -D__PX4_DARWIN + -D__DF_DARWIN -DCLOCK_MONOTONIC=1 -Dnoreturn_function=__attribute__\(\(noreturn\)\) -include ${PX4_INCLUDE_DIR}visibility.h @@ -185,6 +186,7 @@ else() set(added_definitions -D__PX4_POSIX -D__PX4_LINUX + -D__DF_LINUX -DCLOCK_MONOTONIC=1 -Dnoreturn_function=__attribute__\(\(noreturn\)\) -include ${PX4_INCLUDE_DIR}visibility.h diff --git a/src/lib/DriverFramework b/src/lib/DriverFramework index 45878058a7..3bbaf1a46d 160000 --- a/src/lib/DriverFramework +++ b/src/lib/DriverFramework @@ -1 +1 @@ -Subproject commit 45878058a7b37a9bba370396526b95cd7c2a3ab9 +Subproject commit 3bbaf1a46dfdb0b3506dd4a0e4441f17b53c1944 diff --git a/src/lib/dspal b/src/lib/dspal index c8e885aac5..93b8d36619 160000 --- a/src/lib/dspal +++ b/src/lib/dspal @@ -1 +1 @@ -Subproject commit c8e885aac51aa34855bb3880d3dc916b9e278083 +Subproject commit 93b8d366191fb24486e0484ca4f020c85ed6cfee