Suppress warnings from TensorFlow Lite code (#599)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Sun, 15 Jul 2018 06:29:12 +0000 (15:29 +0900)
committerSergey Vostokov/AI Tools Lab /SRR/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Sun, 15 Jul 2018 06:29:12 +0000 (15:29 +0900)
This commit suppresses warnings (clang 7.0 reports) from TensorFlow Lite code.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
cmake/packages/TensorFlowLite/CMakeLists.txt

index 2f6cbc4..0a7f62d 100644 (file)
@@ -22,9 +22,16 @@ list(REMOVE_ITEM KERNEL_SRCS "${TensorFlowLiteSource_DIR}/kernels/internal/spect
 list(APPEND SRCS ${CORE_SRCS})
 list(APPEND SRCS ${KERNEL_SRCS})
 
+include(CheckCXXCompilerFlag)
+
+CHECK_CXX_COMPILER_FLAG(-Wno-extern-c-compat COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING)
+
 add_library(tensorflowlite ${SRCS})
 set_target_properties(tensorflowlite PROPERTIES POSITION_INDEPENDENT_CODE ON)
 target_include_directories(tensorflowlite PUBLIC ${TensorFlowSource_DIR})
 target_compile_options(tensorflowlite PUBLIC -Wno-ignored-attributes)
+if(COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING)
+  target_compile_options(tensorflowlite PUBLIC -Wno-extern-c-compat)
+endif(COMPILER_SUPPORT_EXTERN_C_COMPAT_WARNING)
 target_compile_definitions(tensorflowlite PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK")
 target_link_libraries(tensorflowlite eigen gemmlowp neon2sse farmhash flatbuffers dl)