Merge pull request #95 from dji-sdk/release/v3.4

FIX: fix the nvidia sample compile error issue
This commit is contained in:
DJI
2023-04-20 02:25:18 +08:00
committed by GitHub
17 changed files with 45 additions and 38 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ extern "C" {
#define DJI_VERSION_MINOR 4 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */ #define DJI_VERSION_MINOR 4 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
#define DJI_VERSION_MODIFY 0 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */ #define DJI_VERSION_MODIFY 0 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
#define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */ #define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
#define DJI_VERSION_BUILD 1743 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */ #define DJI_VERSION_BUILD 1749 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ endif ()
include_directories(../../../module_sample) include_directories(../../../module_sample)
include_directories(../../../../sample_c/module_sample) include_directories(../../../../sample_c/module_sample)
include_directories(../common) include_directories(../common)
include_directories(../manifold2/application) include_directories(../nvidia_jeston/application)
file(GLOB_RECURSE MODULE_SAMPLE_SRC file(GLOB_RECURSE MODULE_SAMPLE_SRC
../../../module_sample/liveview/*.c* ../../../module_sample/liveview/*.c*
@@ -36,8 +36,8 @@ add_definitions(-DSYSTEM_ARCH_LINUX=1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/3rdparty) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/3rdparty)
link_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../out/lib/${TOOLCHAIN_NAME}) link_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/${TOOLCHAIN_NAME})
link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../out/lib/${TOOLCHAIN_NAME}/libpayloadsdk.a -lstdc++) link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/${TOOLCHAIN_NAME}/libpayloadsdk.a -lstdc++)
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
${MODULE_APP_SRC} ${MODULE_APP_SRC}
@@ -70,12 +70,13 @@ if (FFMPEG_FOUND)
message(STATUS " - Includes: ${FFMPEG_INCLUDE_DIR}") message(STATUS " - Includes: ${FFMPEG_INCLUDE_DIR}")
message(STATUS " - Libraries: ${FFMPEG_LIBRARIES}") message(STATUS " - Libraries: ${FFMPEG_LIBRARIES}")
add_definitions(-DFFMPEG_INSTALLED) add_definitions(-DFFMPEG_INSTALLED)
include_directories(${FFMPEG_INCLUDE_DIR})
EXECUTE_PROCESS(COMMAND ffmpeg -version EXECUTE_PROCESS(COMMAND ffmpeg -version
OUTPUT_VARIABLE ffmpeg_version_output OUTPUT_VARIABLE ffmpeg_version_psdk_libput
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
string(REGEX MATCH "version.*Copyright" ffmpeg_version_line ${ffmpeg_version_output}) string(REGEX MATCH "version.*Copyright" ffmpeg_version_line ${ffmpeg_version_psdk_libput})
string(REGEX MATCH " .* " ffmpeg_version ${ffmpeg_version_line}) string(REGEX MATCH " .* " ffmpeg_version ${ffmpeg_version_line})
string(REGEX MATCH "^ 5.*$" ffmpeg_major_version ${ffmpeg_version}) string(REGEX MATCH "^ 5.*$" ffmpeg_major_version ${ffmpeg_version})
@@ -90,8 +91,7 @@ else ()
message(STATUS "Cannot Find FFMPEG") message(STATUS "Cannot Find FFMPEG")
endif (FFMPEG_FOUND) endif (FFMPEG_FOUND)
include_directories(${FFMPEG_INCLUDE_DIR}) include_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/include)
include_directories(${CMAKE_CURRENT_LIST_DIR}/../../../../../out/include)
find_package(OPUS REQUIRED) find_package(OPUS REQUIRED)
@@ -3,39 +3,47 @@ project(dji_sdk_demo_on_jeston C)
set(CMAKE_C_FLAGS "-pthread -std=gnu99") set(CMAKE_C_FLAGS "-pthread -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "-pthread") set(CMAKE_EXE_LINKER_FLAGS "-pthread")
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc") set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++") set(CMAKE_CXX_COMPILER "g++")
add_definitions(-D_GNU_SOURCE) add_definitions(-D_GNU_SOURCE)
if (BUILD_TEST_CASES_ON MATCHES TRUE) if (NOT USE_SYSTEM_ARCH)
set(COMMON_CXX_FLAGS "-std=c++11 -pthread") add_definitions(-DSYSTEM_ARCH_LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
endif () endif ()
set(COMMON_CXX_FLAGS "-std=c++11 -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
set(PACKAGE_NAME payloadsdk)
## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
execute_process(COMMAND uname -m
OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
if (DEVICE_SYSTEM_ID MATCHES x86_64)
set(TOOLCHAIN_NAME x86_64-linux-gnu-gcc)
add_definitions(-DPLATFORM_ARCH_x86_64=1)
elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc)
add_definitions(-DPLATFORM_ARCH_aarch64=1)
else ()
message(FATAL_ERROR "FATAL: Please confirm your platform.")
endif ()
file(GLOB_RECURSE MODULE_COMMON_SRC ../common/*.c)
file(GLOB_RECURSE MODULE_HAL_SRC hal/*.c)
file(GLOB_RECURSE MODULE_APP_SRC application/*.c)
file(GLOB_RECURSE MODULE_SAMPLE_SRC ../../../module_sample/*.c)
include_directories(../../../module_sample) include_directories(../../../module_sample)
include_directories(../common) include_directories(../common)
include_directories(../manifold2/application) include_directories(../manifold2/application)
set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc) include_directories(../../../../../psdk_lib/include)
add_definitions(-DPLATFORM_ARCH_aarch64=1) link_directories(../../../../../psdk_lib/lib/${TOOLCHAIN_NAME})
add_definitions(-DSYSTEM_ARCH_LINUX=1) link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/${TOOLCHAIN_NAME}/lib${PACKAGE_NAME}.a)
file(GLOB_RECURSE MODULE_COMMON_SRC ../common/*.c)
file(GLOB_RECURSE MODULE_HAL_SRC hal/*.c)
file(GLOB_RECURSE MODULE_APP_SRC application/*.c)
message("-- Use payload sdk package")
file(GLOB_RECURSE MODULE_SAMPLE_SRC
../../../module_sample/*.c
)
include_directories(../../../../../out/include)
add_library(${PACKAGE_NAME} STATIC IMPORTED GLOBAL)
set_target_properties(${PACKAGE_NAME} PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../../../../out/lib/${TOOLCHAIN_NAME}/lib${PACKAGE_NAME}.a
)
if (NOT EXECUTABLE_OUTPUT_PATH) if (NOT EXECUTABLE_OUTPUT_PATH)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
@@ -47,17 +55,14 @@ add_executable(${PROJECT_NAME}
${MODULE_COMMON_SRC} ${MODULE_COMMON_SRC}
${MODULE_HAL_SRC}) ${MODULE_HAL_SRC})
target_link_libraries(${PROJECT_NAME} m)
target_link_libraries(${PROJECT_NAME} ${PACKAGE_NAME})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/3rdparty) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/3rdparty)
find_package(OPUS REQUIRED) find_package(OPUS REQUIRED)
if (OPUS_FOUND) if (OPUS_FOUND)
message(STATUS "Found OPUS installed in the system") message(STATUS "Found OPUS installed in the system")
message(STATUS " - Includes: ${OPUS_INCLUDE_DIR}") message(STATUS " - Includes: ${OPUS_INCLUDE_DIR}")
message(STATUS " - Libraries: ${OPUS_LIBRARY}") message(STATUS " - Libraries: ${OPUS_LIBRARY}")
add_definitions(-DOPUS_INSTALLED) add_definitions(-DOPUS_INSTALLED)
target_include_directories(${PROJECT_NAME} PRIVATE /usr/local/include/opus)
target_link_libraries(${PROJECT_NAME} /usr/local/lib/libopus.a) target_link_libraries(${PROJECT_NAME} /usr/local/lib/libopus.a)
else () else ()
message(STATUS "Cannot Find OPUS") message(STATUS "Cannot Find OPUS")
@@ -75,6 +80,8 @@ else ()
message(STATUS "Cannot Find LIBUSB") message(STATUS "Cannot Find LIBUSB")
endif (LIBUSB_FOUND) endif (LIBUSB_FOUND)
target_link_libraries(${PROJECT_NAME} m)
add_custom_command(TARGET ${PROJECT_NAME} add_custom_command(TARGET ${PROJECT_NAME}
PRE_LINK COMMAND cmake .. PRE_LINK COMMAND cmake ..
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})