1. fixed potential memory leak issue for ac frame parsing algorithm 2. changed decode API, embedded 'change_wind_direction' into ac_status (not compatible with lower versions) 3. changed CMakeLists.txt
76 lines
2.0 KiB
CMake
76 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
|
|
########################################################
|
|
project(irdecode)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
MESSAGE("compile platform : Linux")
|
|
add_definitions(-DPLATFORM_LINUX)
|
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|
MESSAGE("compile platform : win32")
|
|
add_definitions(-DPLATFORM_WIN32)
|
|
ELSE ()
|
|
MESSAGE("invalid compile platform")
|
|
add_definitions(-DPLATFORM_WIN32)
|
|
ENDIF ()
|
|
|
|
include_directories(
|
|
"src/include")
|
|
|
|
set(LIB_IRDECODE_SRC
|
|
src/ir_utils.c
|
|
src/ir_tv_control.c
|
|
src/ir_ac_apply.c
|
|
src/ir_ac_build_frame.c
|
|
src/ir_ac_parse_parameter.c
|
|
src/ir_ac_parse_forbidden_info.c
|
|
src/ir_ac_parse_frame_info.c
|
|
src/ir_ac_control.c
|
|
src/ir_ac_binary_parse.c
|
|
src/ir_decode.c
|
|
src/ir_decode_test.c)
|
|
|
|
set(BIN_TEST_SRC
|
|
src/ir_decode.c)
|
|
|
|
# SET(CMAKE_SYSTEM_NAME Linux)
|
|
## ARMv7hf cross compile
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++")
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
|
|
|
# SET(CMAKE_SYSTEM_NAME Linux)
|
|
## ARMv7el cross compile
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabi-gcc")
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabi-g++")
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
|
|
|
## ARM64 cross compile
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
|
|
|
add_library(irdecode SHARED
|
|
${LIB_IRDECODE_SRC})
|
|
|
|
target_compile_options(irdecode PRIVATE
|
|
-DBOARD_PC)
|
|
|
|
add_library(irdecode_s STATIC
|
|
${LIB_IRDECODE_SRC})
|
|
|
|
target_compile_options(irdecode_s PRIVATE
|
|
-DBOARD_PC)
|
|
|
|
target_compile_options(irdecode_s PRIVATE
|
|
-fPIC)
|
|
|
|
add_executable(irdecode_test
|
|
${BIN_TEST_SRC})
|
|
|
|
target_link_libraries(irdecode_test PRIVATE
|
|
irdecode)
|
|
|
|
add_subdirectory("src/jni")
|