Mark NNPACK as NOT FOUND if PeachpySource is missing (#5995)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 30 Jul 2019 01:21:19 +0000 (10:21 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 30 Jul 2019 01:21:19 +0000 (10:21 +0900)
The current implement says that NNPACK is available even though
PeachpySource is missing.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
infra/nnfw/cmake/packages/NNPACKConfig.cmake

index c115b2e..97382b7 100644 (file)
@@ -15,7 +15,12 @@ function(_NNPACK_Import)
     nnfw_find_package(SixSource REQUIRED)
     nnfw_find_package(Enum34Source REQUIRED)
     nnfw_find_package(OpcodesSource REQUIRED)
-    nnfw_find_package(PeachpySource REQUIRED)
+    nnfw_find_package(PeachpySource QUIET)
+
+    if(NOT PYTHON_PEACHPY_SOURCE_FOUND)
+        set(NNPACK_FOUND FALSE PARENT_SCOPE)
+        return()
+    endif(NOT PYTHON_PEACHPY_SOURCE_FOUND)
 
     # workaround for CI
     set(THREADS_PTHREAD_ARG "2" CACHE STRING "Forcibly set by CMakeLists.txt." FORCE)