aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRob Hughes <robert.hughes@arm.com>2019-12-20 17:43:16 +0000
committerDerek Lamberti <derek.lamberti@arm.com>2019-12-31 09:54:23 +0000
commitff3c426ffd799abd66e4280da559384d86702721 (patch)
tree9fbee031285d57ea32afc6e2d86a5aace9466a2b /CMakeLists.txt
parentfc6bf05e536ee352a1b304c6acff36c6b9ea0ead (diff)
downloadarmnn-ff3c426ffd799abd66e4280da559384d86702721.tar.gz
Replace Schema.s with generated .cpp file
This removes the dependency on an assembler (which must support .incbin). Instead we use xxd as a custom build command to generate a .cpp file which is included in the build. This makes it possible to build on Windows, for which you need cp.exe (from GNU Core Utils) and xxd.exe (from Vim). Change-Id: I3a929640b1fdbfc27e2c38abd05bf3a298245ba5 Signed-off-by: Robert Hughes <robert.hughes@arm.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 11 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7af6a94760..d0f3d7aebe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -696,7 +696,6 @@ if(BUILD_UNIT_TESTS)
endif()
if(BUILD_TF_LITE_PARSER AND ARMNNREF)
- enable_language(ASM)
list(APPEND unittest_sources
src/armnnTfLiteParser/test/Activations.cpp
src/armnnTfLiteParser/test/Addition.cpp
@@ -738,10 +737,18 @@ if(BUILD_UNIT_TESTS)
src/armnnTfLiteParser/test/GetTensorIds.cpp
src/armnnTfLiteParser/test/GetSubgraphInputsOutputs.cpp
src/armnnTfLiteParser/test/GetInputsOutputs.cpp
- src/armnnTfLiteParser/test/Schema.s
)
- set_source_files_properties(src/armnnTfLiteParser/test/Schema.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
-
+
+ # Generate SchemaText.cpp file which contains the TfLite schema text as a
+ # static C-array of bytes. This is needed at runtime for TfLite parser tests.
+ add_custom_command(
+ OUTPUT SchemaText.cpp
+ COMMAND cp ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs g_TfLiteSchemaText
+ COMMAND xxd -i g_TfLiteSchemaText SchemaText.cpp
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs
+ )
+ list(APPEND unittest_sources ${CMAKE_CURRENT_BINARY_DIR}/SchemaText.cpp)
endif()
if(BUILD_CAFFE_PARSER AND ARMNNREF)