From 4217b437286f7fc9c852094e1ae66550484b4b62 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Wed, 27 Dec 2023 14:54:36 -0800 Subject: [PATCH] Fixed various build issues with the new Serial implementation --- src/lib/drivers/device/CMakeLists.txt | 14 +++++++++----- src/lib/drivers/device/posix/SerialImpl.cpp | 2 +- src/lib/drivers/device/posix/SerialImpl.hpp | 2 +- src/lib/drivers/device/qurt/SerialImpl.cpp | 2 +- src/lib/drivers/device/qurt/SerialImpl.hpp | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lib/drivers/device/CMakeLists.txt b/src/lib/drivers/device/CMakeLists.txt index 3d3eab11d1..6aa1707850 100644 --- a/src/lib/drivers/device/CMakeLists.txt +++ b/src/lib/drivers/device/CMakeLists.txt @@ -49,11 +49,15 @@ elseif((${PX4_PLATFORM} MATCHES "qurt")) list(APPEND SRCS_PLATFORM qurt/uart.c) elseif(UNIX AND NOT APPLE) #TODO: add linux PX4 platform type # Linux I2Cdev and SPIdev - list(APPEND SRCS_PLATFORM - posix/I2C.cpp - posix/SPI.cpp - posix/SerialImpl.cpp - ) + if ("${CONFIG_I2C}" STREQUAL "y") + list(APPEND SRCS_PLATFORM posix/I2C.cpp) + endif() + + if ("${CONFIG_SPI}" STREQUAL "y") + list(APPEND SRCS_PLATFORM posix/SPI.cpp) + endif() + + list(APPEND SRCS_PLATFORM posix/SerialImpl.cpp) endif() px4_add_library(drivers__device diff --git a/src/lib/drivers/device/posix/SerialImpl.cpp b/src/lib/drivers/device/posix/SerialImpl.cpp index c216e32656..8d71c5ac40 100644 --- a/src/lib/drivers/device/posix/SerialImpl.cpp +++ b/src/lib/drivers/device/posix/SerialImpl.cpp @@ -31,7 +31,7 @@ * ****************************************************************************/ -#include +#include "SerialImpl.hpp" #include // strncpy #include #include diff --git a/src/lib/drivers/device/posix/SerialImpl.hpp b/src/lib/drivers/device/posix/SerialImpl.hpp index efc95d7d51..cae5aef84e 100644 --- a/src/lib/drivers/device/posix/SerialImpl.hpp +++ b/src/lib/drivers/device/posix/SerialImpl.hpp @@ -36,7 +36,7 @@ #include #include -#include +#include using device::SerialConfig::ByteSize; using device::SerialConfig::Parity; diff --git a/src/lib/drivers/device/qurt/SerialImpl.cpp b/src/lib/drivers/device/qurt/SerialImpl.cpp index ec0fb73fce..5bbe092bcd 100644 --- a/src/lib/drivers/device/qurt/SerialImpl.cpp +++ b/src/lib/drivers/device/qurt/SerialImpl.cpp @@ -31,7 +31,7 @@ * ****************************************************************************/ -#include +#include "SerialImpl.hpp" #include // strncpy #include #include diff --git a/src/lib/drivers/device/qurt/SerialImpl.hpp b/src/lib/drivers/device/qurt/SerialImpl.hpp index 1b98d3bb40..1bdea98a48 100644 --- a/src/lib/drivers/device/qurt/SerialImpl.hpp +++ b/src/lib/drivers/device/qurt/SerialImpl.hpp @@ -35,7 +35,7 @@ #include -#include +#include using device::SerialConfig::ByteSize; using device::SerialConfig::Parity;