From 70a1301a01464a449b6ab619430b6f2d8820337d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Sun, 15 Jul 2018 15:29:12 +0900 Subject: [PATCH] Suppress warnings from TensorFlow Lite code (#599) This commit suppresses warnings (clang 7.0 reports) from TensorFlow Lite code. Signed-off-by: Jonghyun Park --- cmake/packages/TensorFlowLite/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/packages/TensorFlowLite/CMakeLists.txt b/cmake/packages/TensorFlowLite/CMakeLists.txt index 2f6cbc4..0a7f62d 100644 --- a/cmake/packages/TensorFlowLite/CMakeLists.txt +++ b/cmake/packages/TensorFlowLite/CMakeLists.txt @@ -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) -- 2.7.4