diff options
author | Rob Hughes <robert.hughes@arm.com> | 2020-01-07 13:26:42 +0000 |
---|---|---|
committer | Rob Hughes <robert.hughes@arm.com> | 2020-01-15 16:28:16 +0000 |
commit | c3da2680f605e705c95811c7ba93770e200e5dc0 (patch) | |
tree | ac6ab98ce0c99ff53b1837f3f90e4d98b3b9c4b7 /src/armnnTfLiteParser | |
parent | 5edefa0529b92d4b0652512b1a88ab6b4ec6ade1 (diff) | |
download | armnn-c3da2680f605e705c95811c7ba93770e200e5dc0.tar.gz |
Support different flatbuffer libs for debug and release
The existing FLATBUFFERS_LIBRARY variable is still honoured, but if
not specified then we use CMake's find_library to find the debug and release
variants, using PATH_SUFFIXES to help separate debug and release.
This is the same approach we use for the armcompute libs.
Change-Id: I21e8da3f76669dbfb8dbdf49046f9db46cba50a2
Signed-off-by: Robert Hughes <robert.hughes@arm.com>
Diffstat (limited to 'src/armnnTfLiteParser')
-rwxr-xr-x | src/armnnTfLiteParser/CMakeLists.txt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/armnnTfLiteParser/CMakeLists.txt b/src/armnnTfLiteParser/CMakeLists.txt index ae60079ab6..97c55a1d08 100755 --- a/src/armnnTfLiteParser/CMakeLists.txt +++ b/src/armnnTfLiteParser/CMakeLists.txt @@ -19,7 +19,21 @@ if(BUILD_TF_LITE_PARSER) target_include_directories(armnnTfLiteParser SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") target_link_libraries(armnnTfLiteParser ${Boost_FILESYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) - target_link_libraries(armnnTfLiteParser armnn ${FLATBUFFERS_LIBRARY}) + + # If user has explicitly specified flatbuffers lib then use that, + # otherwise search for it based on FLATBUFFERS_BUILD_DIR + if (FLATBUFFERS_LIBRARY) + target_link_libraries(armnnTfLiteParser armnn ${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") + find_library(FLATBUFFERS_LIBRARY_RELEASE NAMES flatbuffers + HINTS ${FLATBUFFERS_BUILD_DIR} + PATH_SUFFIXES "Release") + target_link_libraries(armnnTfLiteParser armnn debug ${FLATBUFFERS_LIBRARY_DEBUG} optimized ${FLATBUFFERS_LIBRARY_RELEASE}) + endif() set_target_properties(armnnTfLiteParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) |