IVGCVSW-5679 Fix Android NDK OOB build
authorMatthew Sloyan <matthew.sloyan@arm.com>
Tue, 9 Feb 2021 16:46:14 +0000 (16:46 +0000)
committerMatthew Sloyan <matthew.sloyan@arm.com>
Tue, 9 Feb 2021 16:46:14 +0000 (16:46 +0000)
 * Specific OOB builds will fail if flatc is not available.
 * flatc command is now only run if found.

Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Iab6e082fe35dc3c3dfb78a29e1630c9edbb80be6

src/backends/cl/CMakeLists.txt

index 60cdaa3..78771a0 100644 (file)
@@ -8,15 +8,15 @@ if(ARMCOMPUTECL)
                  HINTS ${FLATC_DIR}
                  DOC "Path to 'flatc', the flatbuffers compiler")
     if (NOT FLATC)
-        message(SEND_ERROR "flatc not found. Specify the full path of the flatc executable with -DFLATC=<flatc path>")
+        message(WARNING "flatc not found. Specify the full path of the flatc executable with -DFLATC=<flatc path>")
+    else()
+        add_custom_command(
+            # Updates ClContextSchema_generated.h if changes are made.
+            OUTPUT ClContextSchema_generated.h DEPENDS ClContextSchema.fbs
+            COMMAND ${FLATC} -o ${CMAKE_CURRENT_BINARY_DIR} --cpp ${CMAKE_CURRENT_SOURCE_DIR}/ClContextSchema.fbs
+        )
     endif()
 
-    add_custom_command(
-        # Generate an ClContextSchema_generated.h file if it doesn't exist, or update it when necessary otherwise
-        OUTPUT ClContextSchema_generated.h DEPENDS ClContextSchema.fbs
-        COMMAND ${FLATC} -o ${CMAKE_CURRENT_BINARY_DIR} --cpp ${CMAKE_CURRENT_SOURCE_DIR}/ClContextSchema.fbs
-    )
-
     list(APPEND armnnClBackend_sources
         ClContextSchema_generated.h
         ClBackend.cpp