From f234906aa3c50df7bcafcfa4f25a652d9e874bcb Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 5 Sep 2019 11:13:11 +0900 Subject: [PATCH] Update srcn kernel library cmake (#7135) Use finding arm_neon.h instead of checking target arch Link libraries OpenMP_CXX_LIBRARIES Prepare compile definition NCNN and comment out Signed-off-by: Hyeongseok Oh --- runtimes/libs/srcn/CMakeLists.txt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/runtimes/libs/srcn/CMakeLists.txt b/runtimes/libs/srcn/CMakeLists.txt index f14dd5e..c6ad823 100644 --- a/runtimes/libs/srcn/CMakeLists.txt +++ b/runtimes/libs/srcn/CMakeLists.txt @@ -1,20 +1,26 @@ -if("${TARGET_ARCH}" STREQUAL "x86_64") - return() -endif() - # Find and use pre-installed OpenMP find_package(OpenMP QUIET) if(NOT OpenMP_FOUND) return() endif(NOT OpenMP_FOUND) +# Include arm_neon.h in src/common.h +find_path(TARGET_HEADER arm_neon.h) +if(NOT TARGET_HEADER) + message(STATUS "Check for SRCN kernel library build: need arm_neon header") + return() +else(NOT TARGET_HEADER) + message(STATUS "Check for SRCN kernel library build: OK") +endif(NOT TARGET_HEADER) + file(GLOB_RECURSE SOURCES "*.cc") file(GLOB_RECURSE TESTS "*_test.cc") list(REMOVE_ITEM SOURCES ${TESTS}) add_library(nnfw_lib_srcn STATIC ${SOURCES}) target_include_directories(nnfw_lib_srcn PUBLIC include) -target_link_libraries(nnfw_lib_srcn PRIVATE ${OpenMP_CXX_FLAGS}) +target_link_libraries(nnfw_lib_srcn PRIVATE ${OpenMP_CXX_LIBRARIES}) target_compile_options(nnfw_lib_srcn PRIVATE ${OpenMP_CXX_FLAGS}) -target_compile_options(nnfw_lib_srcn PRIVATE -DTIZEN) +target_compile_definitions(nnfw_lib_srcn PRIVATE TIZEN) # ANDROID or TIZEN +#target_compile_definitions(nnfw_lib_srcn PRIVATE NCNN) # Enable if ready set_target_properties(nnfw_lib_srcn PROPERTIES POSITION_INDEPENDENT_CODE ON) -- 2.7.4