Fix cmake regular expression bug (#4790)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 20 Mar 2019 07:36:22 +0000 (16:36 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 20 Mar 2019 07:36:22 +0000 (16:36 +0900)
Use variable setting instead of regular expression
because option setting by cmake configure is not working
It is temporary solution until changing option setting for each architecture

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
CMakeLists.txt
cmake/CfgOptionFlags.cmake
cmake/option/identify_platform.cmake

index 0d37eb3..18b7ae9 100644 (file)
@@ -60,9 +60,9 @@ option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source"
 option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
 CMAKE_DEPENDENT_OPTION(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source"
                        # Enable ARMCompute build if the target architecture is aarch
-                       OFF "NOT ${TARGET_ARCH_BASE} MATCHES arm*;NOT ${TARGET_ARCH_BASE} MATCHES aarch*"
+                       ON "TARGET_IS_ARMARCH"
                        # Disable ARMCompute build otherwise
-                       ON)
+                       OFF)
 option(DOWNLOAD_NONIUS "Download nonius source" ON)
 option(DOWNLOAD_BOOST "Download boost source" OFF)
 option(BUILD_BOOST "Build boost source" OFF)
index fd08c15..e197f24 100644 (file)
@@ -8,8 +8,8 @@ CMAKE_DEPENDENT_OPTION(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime"
                        # Enable PURE ARMCompute runtime build if the target architecture is aarch
                        #
                        # TODO Enable build if ARMCompute library is available
-                       OFF "NOT ${TARGET_ARCH_BASE} STREQUAL arm;NOT ${TARGET_ARCH_BASE} STREQUAL aarch"
-                       ON)
+                       ON "TARGET_IS_ARMARCH"
+                       OFF)
 option(BUILD_NEURUN "Build neurun" OFF) #if implementation is done, it would replace nn runtime.
 option(BUILD_LOGGING "Build logging runtime" ON)
 CMAKE_DEPENDENT_OPTION(BUILD_RUNTIME_NNAPI_TEST "Build Runtime NN API Generated Test"
index 66e0255..79e309d 100644 (file)
@@ -28,8 +28,12 @@ else()
   message(FATAL_ERROR "'${HOST_ARCH}' architecture is not supported")
 endif()
 
+# TARGET_IS_ARMARCH: for workaround arm-related build option setting
+# TODO Remove TARGET_IS_ARMARCH
+set(TARGET_IS_ARMARCH TRUE)
 if("${TARGET_ARCH}" STREQUAL "x86_64")
   set(TARGET_ARCH_BASE ${TARGET_ARCH})
+  set(TARGET_IS_ARM FALSE)
 elseif("${TARGET_ARCH}" STREQUAL "armv7l")
   set(TARGET_ARCH_BASE "arm")
 elseif("${TARGET_ARCH}" STREQUAL "arm64")