summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Darwin.cmake
diff options
context:
space:
mode:
authorSteve Wilson <stevew@wolfram.com>2019-09-13 17:11:15 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2019-09-28 13:56:46 (GMT)
commit80f120a85fb0992e3f06ad69ebdad881bea9af8c (patch)
tree9cfc710d17bd751932faae6c5dd523764bba78f3 /Modules/Platform/Darwin.cmake
parent8c568722d79f9de0c03550981cbcb9453733a8bb (diff)
downloadCMake-80f120a85fb0992e3f06ad69ebdad881bea9af8c.zip
CMake-80f120a85fb0992e3f06ad69ebdad881bea9af8c.tar.gz
CMake-80f120a85fb0992e3f06ad69ebdad881bea9af8c.tar.bz2
Languages: Add support for Objective-C
Add entries in Modules and Modules/Platform to support Objective-C compiler determination and identification. Add Modules to check Objective-C compiler flags, source compilations, program checks, etc... Use OBJC as the designator of the language, eg: project(foo OBJC) Add various tests for Objective-C language features. Add tests to preserve C++ handling of .m and .mm files when OBJC is not a configured language. Co-Authored-By: Cristian Adam <cristian.adam@gmail.com>
Diffstat (limited to 'Modules/Platform/Darwin.cmake')
-rw-r--r--Modules/Platform/Darwin.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 7e02814..dcda7c5 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -119,10 +119,15 @@ set(CMAKE_C_CREATE_MACOSX_FRAMEWORK
set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+set(CMAKE_OBJC_CREATE_MACOSX_FRAMEWORK
+ "<CMAKE_OBJC_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS> <LINK_FLAGS> -o <TARGET> -dynamiclib -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>"
+)
+
# Set default framework search path flag for languages known to use a
# preprocessor that may find headers in frameworks.
set(CMAKE_C_FRAMEWORK_SEARCH_FLAG -F)
set(CMAKE_CXX_FRAMEWORK_SEARCH_FLAG -F)
+set(CMAKE_OBJC_FRAMEWORK_SEARCH_FLAG -F)
set(CMAKE_Fortran_FRAMEWORK_SEARCH_FLAG -F)
# default to searching for frameworks first
@@ -222,7 +227,7 @@ unset(_apps_paths)
include(Platform/UnixPaths)
if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
- foreach(lang C CXX)
+ foreach(lang C CXX OBJC)
list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
endforeach()
endif()