From 7ff8f8eba4c0e4efb29f9a702d2a256dffc04909 Mon Sep 17 00:00:00 2001 From: Jan Iwaszkiewicz Date: Thu, 11 Feb 2021 16:41:23 +0100 Subject: [PATCH] WA for GCC 7.5 pybind warning (#4277) * WA for GCC 7.5 pybind warning * Move compiler flag to ngraph/python --- CMakeLists.txt | 2 +- ngraph/python/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b8c2631c79..e72f2b61f18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ function(build_ngraph) elseif(WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308 /wd4146 /wd4703 /wd4244 /wd4819") endif() - + if(ENABLE_LTO) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) endif() diff --git a/ngraph/python/CMakeLists.txt b/ngraph/python/CMakeLists.txt index 9fbe284db9c..5840f71214f 100644 --- a/ngraph/python/CMakeLists.txt +++ b/ngraph/python/CMakeLists.txt @@ -60,6 +60,9 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") add_link_options(-stdlib=libc++) add_compile_options(-Wno-unused-value) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # WA for GCC 7.5 "PYBIND11_NOINLINE inline" warning + add_compile_options(-Wno-error=attributes) endif() # create target