From d51fa839cb653211722d6fd2ff9c369fd2c5a862 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: Wed, 20 Mar 2019 16:36:22 +0900 Subject: [PATCH] Fix cmake regular expression bug (#4790) 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 --- CMakeLists.txt | 4 ++-- cmake/CfgOptionFlags.cmake | 4 ++-- cmake/option/identify_platform.cmake | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d37eb3..18b7ae9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/CfgOptionFlags.cmake b/cmake/CfgOptionFlags.cmake index fd08c15..e197f24 100644 --- a/cmake/CfgOptionFlags.cmake +++ b/cmake/CfgOptionFlags.cmake @@ -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" diff --git a/cmake/option/identify_platform.cmake b/cmake/option/identify_platform.cmake index 66e0255..79e309d 100644 --- a/cmake/option/identify_platform.cmake +++ b/cmake/option/identify_platform.cmake @@ -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") -- 2.7.4