summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-29 18:00:19 (GMT)
committerBrad King <brad.king@kitware.com>2021-02-03 17:26:58 (GMT)
commitddaaee907dc617f6a763de37c368e50cd23a8a53 (patch)
tree08b3b7179f6c4a880f2e3100e4bb2866a7ed80b3 /Modules/CMakeDetermineCompilerId.cmake
parent69e1d95a8a6c75f7a1be1259fefe938265cbf4dc (diff)
downloadCMake-ddaaee907dc617f6a763de37c368e50cd23a8a53.zip
CMake-ddaaee907dc617f6a763de37c368e50cd23a8a53.tar.gz
CMake-ddaaee907dc617f6a763de37c368e50cd23a8a53.tar.bz2
CMakeDetermineCompilerId: Recognize XCOFF executable format
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 90697f0..1be570e 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -920,6 +920,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE INTERNAL "Executable file format")
endif()
+ # XCOFF files start with 0x01 followed by 0xDF (32-bit) or 0xF7 (64-bit).
+ if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "^01(df|f7)")
+ set(CMAKE_EXECUTABLE_FORMAT "XCOFF" CACHE INTERNAL "Executable file format")
+ endif()
+
endif()
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
set(CMAKE_EXECUTABLE_FORMAT)