diff options
author | Brad King <brad.king@kitware.com> | 2021-01-29 18:00:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-03 17:26:58 (GMT) |
commit | ddaaee907dc617f6a763de37c368e50cd23a8a53 (patch) | |
tree | 08b3b7179f6c4a880f2e3100e4bb2866a7ed80b3 /Modules/CMakeDetermineCompilerId.cmake | |
parent | 69e1d95a8a6c75f7a1be1259fefe938265cbf4dc (diff) | |
download | CMake-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.cmake | 5 |
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) |