mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
cmake: disable 'attributes' error to fix the build with GCC < 9.x
This patch fixes the error "requested alignment X is larger than Y" in older GCC's https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89357
This commit is contained in:
parent
bb09acffed
commit
6bbf016dc4
1 changed files with 8 additions and 0 deletions
|
|
@ -491,6 +491,14 @@ if (onnxruntime_CROSS_COMPILING)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||
check_cxx_compiler_flag(-Wno-error HAS_NOERROR)
|
||||
if (HAS_NOERROR)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-error=attributes")
|
||||
string(APPEND CMAKE_C_FLAGS " -Wno-error=attributes")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Mark symbols to be invisible, for macOS/iOS target only
|
||||
# Due to many dependencies have different symbol visibility settings, set global compile flags here.
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|iOS")
|
||||
|
|
|
|||
Loading…
Reference in a new issue