попытки сделать crsf, не взлетела часть с пультом
This commit is contained in:
@@ -6,8 +6,33 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
option(ENABLE_GROUND_BUILD "Enable build ground station" OFF)
|
||||
option(ENABLE_AIR_BUILD "Enable build air" ON)
|
||||
|
||||
if(WIN32)
|
||||
set(PORT_SPECIFIC_FILES
|
||||
lib/port/win/poller.cpp
|
||||
lib/port/win/uart.cpp
|
||||
lib/port/win/udp.cpp
|
||||
)
|
||||
else ()
|
||||
set(PORT_SPECIFIC_FILES
|
||||
lib/port/unix/poller.cpp
|
||||
lib/port/unix/uart.cpp
|
||||
lib/port/unix/udp.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(LIB_FILES
|
||||
${PORT_SPECIFIC_FILES}
|
||||
lib/crsf.cpp
|
||||
lib/crsf.h
|
||||
lib/port/poller-general.cpp
|
||||
lib/port/poller.h
|
||||
lib/port/uart.h
|
||||
lib/port/udp.h
|
||||
)
|
||||
|
||||
if (ENABLE_GROUND_BUILD)
|
||||
message("Enabled ground build!")
|
||||
|
||||
# Настройки для Windows
|
||||
if(WIN32)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
@@ -17,18 +42,13 @@ if (ENABLE_GROUND_BUILD)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
|
||||
add_executable(${PROJECT_NAME}-ground
|
||||
ground/joystick-reader.cpp
|
||||
ground/joystick-reader.h
|
||||
ground/main.cpp
|
||||
ground/udp-driver.cpp
|
||||
ground/udp-driver.h
|
||||
${LIB_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}-ground ${SDL2_LIBRARIES} ${EXTRA_LIBS})
|
||||
target_link_libraries(${PROJECT_NAME}-ground ${EXTRA_LIBS})
|
||||
target_include_directories(${PROJECT_NAME}-ground PRIVATE ground/ lib/)
|
||||
endif()
|
||||
|
||||
if (ENABLE_AIR_BUILD)
|
||||
@@ -36,6 +56,8 @@ if (ENABLE_AIR_BUILD)
|
||||
|
||||
add_executable(${PROJECT_NAME}-air
|
||||
air/main.cpp
|
||||
${LIB_FILES}
|
||||
)
|
||||
target_include_directories(${PROJECT_NAME}-air PRIVATE air/ lib/)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user