diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6199c85750..123b2dec9f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -40,6 +40,10 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose build type: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() +if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 8) + message(FATAL_ERROR "GCC version must not less than 8") +endif() + # Options option(onnxruntime_RUN_ONNX_TESTS "Enable ONNX Compatibility Testing" OFF) option(onnxruntime_GENERATE_TEST_REPORTS "Enable test report generation" OFF)