From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Wed, 20 Mar 2019 07:36:22 +0000 (+0900) Subject: Fix cmake regular expression bug (#4790) X-Git-Tag: submit/tizen/20190325.013700~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d51fa839cb653211722d6fd2ff9c369fd2c5a862;p=platform%2Fcore%2Fml%2Fnnfw.git 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 --- 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")