Commit c86e82c0 authored by Maikel van den Hurk's avatar Maikel van den Hurk Committed by Brad King

Add Mach-O CMAKE_EXECUTABLE_FORMAT detection

Code for this was prototyped when ELF detection was added long ago but
left commented out.  Use either MH_MAGIC or MH_CIGAM for the 32-bit
variant and use either or MH_MAGIC_64 or MH_CIGAM_64 for the 64-bit
variant.
parent 4b513c0c
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment