Platform specific cmake option setting (#4898)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 1 Apr 2019 05:31:19 +0000 (14:31 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 1 Apr 2019 05:31:19 +0000 (14:31 +0900)
Make platform specific cmake option setting files
Platform specific setting have higher priority than common setting

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
cmake/CfgOptionFlags.cmake
cmake/options/options_aarch64-linux.cmake [new file with mode: 0644]
cmake/options/options_aarch64-tizen.cmake [new file with mode: 0644]
cmake/options/options_arm64-android.cmake [new file with mode: 0644]
cmake/options/options_armv7l-linux.cmake [new file with mode: 0644]
cmake/options/options_armv7l-tizen.cmake [new file with mode: 0644]
cmake/options/options_x86_64-linux.cmake [new file with mode: 0644]

index 8c31e3f..02997b6 100644 (file)
@@ -1,15 +1,16 @@
 include(CMakeDependentOption)
 
 #
+# Platfor specific configuration
+# note: this should be placed before platform common setting for option setting priority
+#       (platform specific setting have higher priority)
+#
+include("cmake/options/options_${TARGET_PLATFORM}.cmake")
+
+#
 # Build configuration for project
 #
 option(BUILD_EXT_MULTITHREAD "Build external build using multi thread" ON)
-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
-                       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"
@@ -22,11 +23,6 @@ option(BUILD_TFLITE_RUN "Build tflite-run" ON)
 option(BUILD_TFLITE_BENCHMARK_MODEL "Build tflite benchmark model" OFF)
 option(BUILD_NNAPI_QUICKCHECK "Build NN API Quickcheck tools" OFF)
 option(BUILD_TOOLS "Bulid nnfw projects under tools/" ON)
-CMAKE_DEPENDENT_OPTION(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite"
-                       # Enable android support for android build
-                       ON "${TARGET_OS} STREQUAL android"
-                       # Disable android support otherwise
-                       OFF)
 #
 # Build configuration for contrib
 #
@@ -48,11 +44,6 @@ option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" ON)
 option(DOWNLOAD_FLATBUFFERS "Download FlatBuffers source" ON)
 option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source" ON)
 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
-                       ON "TARGET_IS_ARMARCH"
-                       # Disable ARMCompute build otherwise
-                       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/options/options_aarch64-linux.cmake b/cmake/options/options_aarch64-linux.cmake
new file mode 100644 (file)
index 0000000..caabe48
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# aarch64 linux cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF)
diff --git a/cmake/options/options_aarch64-tizen.cmake b/cmake/options/options_aarch64-tizen.cmake
new file mode 100644 (file)
index 0000000..e285c6d
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# aarch64 tizen cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF)
diff --git a/cmake/options/options_arm64-android.cmake b/cmake/options/options_arm64-android.cmake
new file mode 100644 (file)
index 0000000..431970c
--- /dev/null
@@ -0,0 +1,8 @@
+# arm64 android cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" ON)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF)
+
diff --git a/cmake/options/options_armv7l-linux.cmake b/cmake/options/options_armv7l-linux.cmake
new file mode 100644 (file)
index 0000000..2e2c989
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# armv7l linux cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF)
diff --git a/cmake/options/options_armv7l-tizen.cmake b/cmake/options/options_armv7l-tizen.cmake
new file mode 100644 (file)
index 0000000..defdfba
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# armv7l tizen cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" ON)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" OFF)
diff --git a/cmake/options/options_x86_64-linux.cmake b/cmake/options/options_x86_64-linux.cmake
new file mode 100644 (file)
index 0000000..7812857
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# x86_64 linux cmake options
+#
+option(BUILD_PURE_ARM_COMPUTE "Build pure_arm_compute runtime" OFF)
+option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" OFF)
+option(BUILD_ANDROID_TFLITE "Enable android support for TensorFlow Lite" OFF)
+option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" OFF)
+option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" ON)