summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-12-12 13:24:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-12-12 13:25:04 (GMT)
commita23ac516b3ccdba9efb22f19edcb7cd676a510b4 (patch)
treea579ffd2c83ef60fd4c8e889b0db4e4f7eb4d446 /Modules
parent4a5e003d4c69c054a7e0123d9ec3adb5bdbd6e39 (diff)
parentc86e82c09299211c76366640dd0f21a6d5acc9e8 (diff)
downloadCMake-a23ac516b3ccdba9efb22f19edcb7cd676a510b4.zip
CMake-a23ac516b3ccdba9efb22f19edcb7cd676a510b4.tar.gz
CMake-a23ac516b3ccdba9efb22f19edcb7cd676a510b4.tar.bz2
Merge topic 'machoFormat'
c86e82c092 Add Mach-O CMAKE_EXECUTABLE_FORMAT detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2722
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake11
1 files changed, 4 insertions, 7 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 5e2df26a..050d3e7 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -659,13 +659,10 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# endif()
#
-# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
-# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# endif()
-# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
-# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# endif()
+ # Mach-O files start with MH_MAGIC or MH_CIGAM
+ if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface|cefaedfe|feedfacf|cffaedfe")
+ set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+ endif()
endif()
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)