gcc 8.0+ adds `class-memaccess` diagnostic, making flatbuffers build fail when Werror is enabled
This disables class-memaccess diagnostic for gcc versions greater than 8.0
Signed-off-by: Vladimir Plazun <v.plazun@samsung.com>
# NOTE Do NOT retry Flatbuffers build once it fails
file(WRITE "${STAMP_PATH}")
+ set(ADDITIONAL_CXX_FLAGS "")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
+ set(ADDITIONAL_CXX_FLAGS "-Wno-error=class-memaccess")
+ endif()
+
execute_process(COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${FLATBUFFERS_INSTALL}
-DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_CXX_FLAGS=${ADDITIONAL_CXX_FLAGS}
${FlatBuffersSource_DIR}
OUTPUT_FILE ${LOG_PATH}
ERROR_FILE ${LOG_PATH}