mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
Configuration - Message about compiler limitation #311
Build System - Add compiler version checks for C++17 support
This commit is contained in:
parent
73fcf4b4ed
commit
2027acc3de
@ -75,6 +75,10 @@ endmacro()
|
|||||||
# COMPILER variable
|
# COMPILER variable
|
||||||
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
|
if (MSVC_VERSION LESS 1914)
|
||||||
|
message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
|
|
||||||
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
|
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
|
||||||
set (COMPILER vc7)
|
set (COMPILER vc7)
|
||||||
elseif (MSVC_VERSION EQUAL 1400)
|
elseif (MSVC_VERSION EQUAL 1400)
|
||||||
@ -92,20 +96,39 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
|||||||
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
|
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
|
||||||
# Since Visual Studio 15 (2017), its version diverged from version of
|
# Since Visual Studio 15 (2017), its version diverged from version of
|
||||||
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
|
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
|
||||||
# we keep its id as "vc14" to be compatibille
|
# we keep its id as "vc14" to be compatible
|
||||||
set (COMPILER vc14)
|
set (COMPILER vc14)
|
||||||
else()
|
else()
|
||||||
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
|
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
|
||||||
endif()
|
endif()
|
||||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
|
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||||
|
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
set (COMPILER gcc)
|
set (COMPILER gcc)
|
||||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||||
|
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
set (COMPILER gxx)
|
set (COMPILER gxx)
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||||
|
if(APPLE)
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
|
||||||
|
message (AUTHOR_WARNING "Apple Clang version 11.0.0 or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||||
|
message (AUTHOR_WARNING "Clang version 7.0 or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
set (COMPILER clang)
|
set (COMPILER clang)
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
|
||||||
|
message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
|
||||||
|
endif()
|
||||||
set (COMPILER icc)
|
set (COMPILER icc)
|
||||||
else()
|
else()
|
||||||
|
message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
|
||||||
set (COMPILER ${CMAKE_GENERATOR})
|
set (COMPILER ${CMAKE_GENERATOR})
|
||||||
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
|
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user