CMake: reject older GCC version when using precompiled Linux libraries

In the situation where the precompiled libraries are used on Linux +
GCC, a version of GCC older than 9.3 is guaranteed to cause problems.

This just implents a fatal error message when we know it doesn't make
sense to continue. We could do more checks and add some warnings, but
it's very likely that these will be ignored amongst the other noise.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D8396
This commit is contained in:
Sybren A. Stüvel 2020-07-27 17:29:13 +02:00
parent d64e171c4b
commit a5b2aa96e4
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ if(NOT DEFINED LIBDIR)
elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
if(CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)
message(FATAL_ERROR "GCC version must be at least 9.3 for precompiled libraries, found ${CMAKE_C_COMPILER_VERSION}")
endif()
endif()
# Avoid namespace pollustion.