mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03:00
Compiler ID: Compiler versions must be a valid, numeric version string.
This test helps catch errors in compiler identification.
This commit is contained in:
1 parent
060442c2e8
commit
25211d756f
3 files changed
+21
No files matched your search
@@ -12,3 +12,10 @@ foreach(v
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Version numbers may only contain numbers and periods.
|
||||
if(NOT CMAKE_C_COMPILER_VERSION MATCHES
|
||||
"^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
|
||||
)
|
||||
message(SEND_ERROR "Compiler version is not numeric!")
|
||||
endif()
|
||||
@@ -12,3 +12,10 @@ foreach(v
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Version numbers may only contain numbers and periods.
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION MATCHES
|
||||
"^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
|
||||
)
|
||||
message(SEND_ERROR "Compiler version is not numeric!")
|
||||
endif()
|
||||
@@ -12,3 +12,10 @@ foreach(v
|
||||
message(SEND_ERROR "${v} not set!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Version numbers may only contain numbers and periods.
|
||||
if(NOT CMAKE_Fortran_COMPILER_VERSION MATCHES
|
||||
"^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
|
||||
)
|
||||
message(SEND_ERROR "Compiler version is not numeric!")
|
||||
endif()
|
||||
Reference in new issue
Block a user