diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-01-23 10:20:04 +0000 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-01-23 14:51:11 +0000 |
commit | c01da459e63461dc0ecfe855fd3254c938689386 (patch) | |
tree | de12240bac086b5ec751c3f76a2f64340b2e082a /CMakeLists.txt | |
parent | 6b74da0d8bca1d51c520bea275df1cc5560c0c96 (diff) | |
download | armnn-c01da459e63461dc0ecfe855fd3254c938689386.tar.gz |
Refactor TOSA Common to be built without enabling the TOSA Reference backend
* The only way to build TOSA common was to enable ARMNNTOSAREF.
* Only include and link the required headers/libraries for TOSA Common.
* Remove duplicate include_directories calls.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Ia5a19bf5b0bb903be0248ac550439df1e8ac5aa7
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 476e080442..9eab90afef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -508,34 +508,36 @@ endif() # Flatbuffers is not included in armnn if the armnnSerializer is not present # Required to target link both flatbuffers and tosa_serialization_lib to armnn -if (ARMNNTOSAREF) +if(ARMNNTOSACOMMON) if (FLATBUFFERS_LIBRARY) target_link_libraries(armnn PUBLIC ${FLATBUFFERS_LIBRARY}) else() # Use PATH_SUFFIXES to help find separate libs for debug/release on Windows builds find_library(FLATBUFFERS_LIBRARY_DEBUG NAMES flatbuffers - HINTS ${FLATBUFFERS_BUILD_DIR} - PATH_SUFFIXES "Debug") + HINTS ${FLATBUFFERS_BUILD_DIR} + PATH_SUFFIXES "Debug") find_library(FLATBUFFERS_LIBRARY_RELEASE NAMES flatbuffers - HINTS ${FLATBUFFERS_BUILD_DIR} - PATH_SUFFIXES "Release") + HINTS ${FLATBUFFERS_BUILD_DIR} + PATH_SUFFIXES "Release") target_link_libraries(armnn PUBLIC - debug ${FLATBUFFERS_LIBRARY_DEBUG} - optimized ${FLATBUFFERS_LIBRARY_RELEASE}) + debug ${FLATBUFFERS_LIBRARY_DEBUG} + optimized ${FLATBUFFERS_LIBRARY_RELEASE}) endif() if (TOSA_SERIALIZATION_LIB) target_link_libraries(armnn PUBLIC -Wl,--whole-archive ${TOSA_SERIALIZATION_LIB} -Wl,--no-whole-archive) else() find_library(TOSA_SERIALIZATION_LIB - NAMES libtosa_serialization_lib.a tosa_serialization_lib - HINTS ${TOSA_SERIALIZATION_LIB_ROOT}/lib /usr/local/lib /usr/lib) + NAMES libtosa_serialization_lib.a tosa_serialization_lib + HINTS ${TOSA_SERIALIZATION_LIB_ROOT}/lib /usr/local/lib /usr/lib) message(STATUS "TOSA serialization library set to ${TOSA_SERIALIZATION_LIB}") target_link_libraries(armnn PUBLIC -Wl,--whole-archive ${TOSA_SERIALIZATION_LIB} -Wl,--no-whole-archive) endif() +endif() +if (ARMNNTOSAREF) if (TOSA_REFERENCE_MODEL_LIB) target_link_libraries(armnn PUBLIC -Wl,--whole-archive ${TOSA_REFERENCE_MODEL_LIB} -Wl,--no-whole-archive) else() |