Skip to content

Commit

Permalink
Removed ngraph-specific variable with flags (#4232)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Feb 11, 2021
1 parent 1da8f65 commit 2a2ef7d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
21 changes: 0 additions & 21 deletions ngraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,6 @@ if (LINUX)
endif()
endif()

#-----------------------------------------------------------------------------------------------
# Compile Flags to pass to external projects...
#-----------------------------------------------------------------------------------------------

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (DEFINED NGRAPH_USE_CXX_ABI)
message( STATUS "nGraph using CXX11 ABI: " ${NGRAPH_USE_CXX_ABI} )
list(APPEND NGRAPH_COMMON_FLAGS -D_GLIBCXX_USE_CXX11_ABI=${NGRAPH_USE_CXX_ABI})
endif()
endif()

string(REPLACE " " ";" NGRAPH_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " " ";" NGRAPH_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
list(APPEND NGRAPH_COMMON_CXX_FLAGS ${NGRAPH_CMAKE_CXX_FLAGS} ${NGRAPH_COMMON_FLAGS})
list(APPEND NGRAPH_COMMON_C_FLAGS ${NGRAPH_CMAKE_C_FLAGS} ${NGRAPH_COMMON_FLAGS})
message(STATUS "NGRAPH_COMMON_CXX_FLAGS ${NGRAPH_COMMON_CXX_FLAGS}")
message(STATUS "NGRAPH_COMMON_C_FLAGS ${NGRAPH_COMMON_C_FLAGS}")

# Set baseline flags for nGraph source files
string(REPLACE ";" " " CMAKE_ORIGINAL_CXX_FLAGS "${NGRAPH_COMMON_CXX_FLAGS}")

#-----------------------------------------------------------------------------------------------
# Compile Flags for nGraph...
#-----------------------------------------------------------------------------------------------
Expand Down
10 changes: 1 addition & 9 deletions ngraph/cmake/external_gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ if(CMAKE_BUILD_TYPE)
)
endif()

if(UNIX)
# workaround for compile error
# related: https://github.com/intel/mkl-dnn/issues/55
set(GTEST_CXX_FLAGS "-Wno-unused-result ${CMAKE_ORIGINAL_CXX_FLAGS} -Wno-undef")
else()
set(GTEST_CXX_FLAGS ${CMAKE_ORIGINAL_CXX_FLAGS})
endif()

#Build for ninja
# Build for ninja
SET(GTEST_PATHS ${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX}
${GMOCK_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmockd${CMAKE_STATIC_LIBRARY_SUFFIX}
${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
Expand Down
9 changes: 0 additions & 9 deletions ngraph/cmake/external_onnx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@ set(ONNX_VERSION 1.8.1)
# Download and install libonnx ...
#------------------------------------------------------------------------------

# Since this file is going to be modifying CMAKE_CXX_FLAGS we need to preserve
# it so we won't overwrite the caller's CMAKE_CXX_FLAGS
set(PUSH_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})

set(ONNX_GIT_REPO_URL https://github.com/onnx/onnx.git)
set(ONNX_GIT_BRANCH rel-${ONNX_VERSION})
set(NGRAPH_ONNX_NAMESPACE ngraph_onnx)

set(CMAKE_CXX_FLAGS ${CMAKE_ORIGINAL_CXX_FLAGS})

FetchContent_Declare(
ext_onnx
GIT_REPOSITORY ${ONNX_GIT_REPO_URL}
Expand Down Expand Up @@ -77,6 +71,3 @@ endif()

set(ONNX_INCLUDE_DIR ${ext_onnx_SOURCE_DIR})
set(ONNX_PROTO_INCLUDE_DIR ${ext_onnx_BINARY_DIR})

# Now make sure we restore the original CMAKE_CXX_FLAGS for the caller
set(CMAKE_CXX_FLAGS ${PUSH_CMAKE_CXX_FLAGS})

0 comments on commit 2a2ef7d

Please sign in to comment.