mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
GHS: Add Compiler ID detection
-- Detect GHS compiler and version Detect ARCHITECTURE_ID for PPC / ARM / 86 targets Detect PLATFORM_ID for Integrity and Integrity178 platforms Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86 -- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator Works around issue with some GHS compilers not setting __ghs__ compiler define -- Tweak Compiler ID checking so major id of 002017 is not replaced with 217 -- Prefer try_compile() library targets when testing for working GHS compilers -- Avoid CMake errors if reading past end of file for checking if file is PE executable
This commit is contained in:
@@ -22,6 +22,7 @@ unset(CMAKE_C_COMPILER_WORKS CACHE)
|
||||
# any makefiles or projects.
|
||||
if(NOT CMAKE_C_COMPILER_WORKS)
|
||||
PrintTestCompilerStatus("C" "")
|
||||
__TestCompiler_setTryCompileTargetType()
|
||||
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
|
||||
"#ifdef __cplusplus\n"
|
||||
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
|
||||
@@ -41,6 +42,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
|
||||
set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
|
||||
unset(CMAKE_C_COMPILER_WORKS CACHE)
|
||||
set(C_TEST_WAS_RUN 1)
|
||||
__TestCompiler_restoreTryCompileTargetType()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_WORKS)
|
||||
|
||||
Reference in New Issue
Block a user