Update armcl-ex library cmake (#7167)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 5 Sep 2019 05:27:21 +0000 (14:27 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 5 Sep 2019 05:27:21 +0000 (14:27 +0900)
Use finding arm compute package instead of  checking target arch
Use target_compile_definition for preprocessor and merge

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/libs/ARMComputeEx/CMakeLists.txt

index 5c703bd..ba1536d 100644 (file)
@@ -1,8 +1,11 @@
-if("${TARGET_ARCH}" STREQUAL "x86_64")
-  return()
-endif()
+nnfw_find_package(ARMCompute QUIET)
 
-nnfw_find_package(ARMCompute REQUIRED)
+if(NOT ARMCompute_FOUND)
+  message(STATUS "Check ARM Compute library extension build: need ARM Compute library")
+  return()
+else(NOT ARMCompute_FOUND)
+  message(STATUS "Check ARM Compute library extension build: OK")
+endif(NOT ARMCompute_FOUND)
 
 set(ACL_EX_BASE ${CMAKE_CURRENT_SOURCE_DIR})
 
@@ -15,15 +18,14 @@ execute_process (
 )
 
 add_library(arm_compute_ex SHARED ${ACL_EX_SRCS})
-set_target_properties(arm_compute_ex PROPERTIES COMPILE_FLAGS "-DEMBEDDED_KERNELS=1")
 target_include_directories(arm_compute_ex PUBLIC ${ACL_EX_BASE})
 target_link_libraries(arm_compute_ex PRIVATE arm_compute_core)
 target_link_libraries(arm_compute_ex PRIVATE nnfw_common)
 target_link_libraries(arm_compute_ex PRIVATE nnfw_coverage)
 # Defines to enable validate check in debug build
-target_compile_options(arm_compute_ex PRIVATE $<$<CONFIG:Debug>:-DARM_COMPUTE_DEBUG_ENABLED>)
-target_compile_options(arm_compute_ex PRIVATE $<$<CONFIG:Debug>:-DARM_COMPUTE_ASSERTS_ENABLED>)
-target_compile_options(arm_compute_ex PRIVATE $<$<CONFIG:Debug>:-DARM_COMPUTE_LOGGING_ENABLED>)
+target_compile_definitions(arm_compute_ex PRIVATE EMBEDDED_KERNELS
+                                                  $<$<CONFIG:Debug>:ARM_COMPUTE_DEBUG_ENABLED ARM_COMPUTE_ASSERTS_ENABLED
+                                                                    ARM_COMPUTE_LOGGING_ENABLED>)
 # Validate check functions are not used on release build
 # Some parameter are used for validate check function call, and these parameter may not used on release build
 target_compile_options(arm_compute_ex PRIVATE $<$<NOT:$<CONFIG:Debug>>:-Wno-unused-parameter -Wno-unused-function>)