Merge topic 'improve-embarcadero'

7a327727 Embarcadero: Fix erroneous interpretation of __CODEGEARC_VERSION__.
25211d75 Compiler ID: Compiler versions must be a valid, numeric version string.
060442c2 Embarcadero:  Check code using CMAKE_CXX_COMPILER_ID and CMAKE_C_COMPILER_ID.
f3b3219c Embarcadero/Watcom: Properly skip VSResource test for other generators.
ddbda722 Embarcadero: Fix bug where duplicate Ninja job pools would be created.
This commit is contained in:
Brad King 2015-12-04 09:54:18 -05:00 committed by CMake Topic Stage
commit 5875801293
8 changed files with 33 additions and 5 deletions

View File

@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__
set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)")
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CODEGEARC_VERSION__ & 0xFFFF)")

View File

@ -230,7 +230,11 @@ macro(_test_compiler_hidden_visibility)
endmacro()
macro(_test_compiler_has_deprecated)
# NOTE: Some Embarcadero compilers silently compile __declspec(deprecated)
# without error, but this is not a documented feature and the attribute does
# not actually generate any warnings.
if(CMAKE_CXX_COMPILER_ID MATCHES Borland
OR CMAKE_CXX_COMPILER_ID MATCHES Embarcadero
OR CMAKE_CXX_COMPILER_ID MATCHES HP
OR GCC_TOO_OLD
OR CMAKE_CXX_COMPILER_ID MATCHES PGI

View File

@ -78,7 +78,11 @@ set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_R
# invocations within a single working directory.
if(NOT DEFINED CMAKE_JOB_POOL_LINK)
set(CMAKE_JOB_POOL_LINK BCC32LinkPool)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1)
get_property(_bccjp GLOBAL PROPERTY JOB_POOLS)
if(NOT _bccjp MATCHES "BCC32LinkPool=")
set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1)
endif()
unset(_bccjp)
endif()
macro(__embarcadero_language lang)

View File

@ -269,8 +269,7 @@ if(BUILD_TESTING)
set(TEST_RESOURCES TRUE)
endif()
# for borland and watcom there is no resource support
if("${CMAKE_GENERATOR}" MATCHES "WMake" OR
"${CMAKE_GENERATOR}" MATCHES "Borland")
if(WATCOM OR BORLAND)
set(TEST_RESOURCES FALSE)
endif()
if(TEST_RESOURCES)

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -22,7 +22,7 @@ set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
${cxx_tests}
)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland|Embarcadero")
set_property(TARGET CompileOptions APPEND PROPERTY COMPILE_OPTIONS
"-DTEST_OCTOTHORPE=\"#\""
)