diff options
author | Steve Wilson <stevew@wolfram.com> | 2019-09-13 17:11:15 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2019-09-28 13:56:46 (GMT) |
commit | 80f120a85fb0992e3f06ad69ebdad881bea9af8c (patch) | |
tree | 9cfc710d17bd751932faae6c5dd523764bba78f3 /Modules/CMakeOBJCCompiler.cmake.in | |
parent | 8c568722d79f9de0c03550981cbcb9453733a8bb (diff) | |
download | CMake-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/CMakeOBJCCompiler.cmake.in')
-rw-r--r-- | Modules/CMakeOBJCCompiler.cmake.in | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in new file mode 100644 index 0000000..1555517 --- /dev/null +++ b/Modules/CMakeOBJCCompiler.cmake.in @@ -0,0 +1,69 @@ +set(CMAKE_OBJC_COMPILER "@CMAKE_OBJC_COMPILER@") +set(CMAKE_OBJC_COMPILER_ARG1 "@CMAKE_OBJC_COMPILER_ARG1@") +set(CMAKE_OBJC_COMPILER_ID "@CMAKE_OBJC_COMPILER_ID@") +set(CMAKE_OBJC_COMPILER_VERSION "@CMAKE_OBJC_COMPILER_VERSION@") +set(CMAKE_OBJC_COMPILER_VERSION_INTERNAL "@CMAKE_OBJC_COMPILER_VERSION_INTERNAL@") +set(CMAKE_OBJC_COMPILER_WRAPPER "@CMAKE_OBJC_COMPILER_WRAPPER@") +set(CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_OBJC_COMPILE_FEATURES "@CMAKE_OBJC_COMPILE_FEATURES@") +set(CMAKE_OBJC90_COMPILE_FEATURES "@CMAKE_OBJC90_COMPILE_FEATURES@") +set(CMAKE_OBJC99_COMPILE_FEATURES "@CMAKE_OBJC99_COMPILE_FEATURES@") +set(CMAKE_OBJC11_COMPILE_FEATURES "@CMAKE_OBJC11_COMPILE_FEATURES@") + +set(CMAKE_OBJC_PLATFORM_ID "@CMAKE_OBJC_PLATFORM_ID@") +set(CMAKE_OBJC_SIMULATE_ID "@CMAKE_OBJC_SIMULATE_ID@") +set(CMAKE_OBJC_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJC_COMPILER_FRONTEND_VARIANT@") +set(CMAKE_OBJC_SIMULATE_VERSION "@CMAKE_OBJC_SIMULATE_VERSION@") +@_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@ +@SET_CMAKE_XCODE_ARCHS@ +set(CMAKE_AR "@CMAKE_AR@") +set(CMAKE_OBJC_COMPILER_AR "@CMAKE_OBJC_COMPILER_AR@") +set(CMAKE_RANLIB "@CMAKE_RANLIB@") +set(CMAKE_OBJC_COMPILER_RANLIB "@CMAKE_OBJC_COMPILER_RANLIB@") +set(CMAKE_LINKER "@CMAKE_LINKER@") +set(CMAKE_MT "@CMAKE_MT@") +set(CMAKE_COMPILER_IS_GNUOBJC @CMAKE_COMPILER_IS_GNUOBJC@) +set(CMAKE_OBJC_COMPILER_LOADED 1) +set(CMAKE_OBJC_COMPILER_WORKS @CMAKE_OBJC_COMPILER_WORKS@) +set(CMAKE_OBJC_ABI_COMPILED @CMAKE_OBJC_ABI_COMPILED@) + +set(CMAKE_OBJC_COMPILER_ENV_VAR "OBJC") + +set(CMAKE_OBJC_COMPILER_ID_RUN 1) +set(CMAKE_OBJC_SOURCE_FILE_EXTENSIONS m) +set(CMAKE_OBJC_IGNORE_EXTENSIONS h;H;o;O) +set(CMAKE_OBJC_LINKER_PREFERENCE 5) + +foreach (lang C CXX OBJCXX) + foreach(extension IN LISTS CMAKE_OBJC_SOURCE_FILE_EXTENSIONS) + if (CMAKE_${lang}_COMPILER_ID_RUN) + list(REMOVE_ITEM CMAKE_${lang}_SOURCE_FILE_EXTENSIONS ${extension}) + endif() + endforeach() +endforeach() + +# Save compiler ABI information. +set(CMAKE_OBJC_SIZEOF_DATA_PTR "@CMAKE_OBJC_SIZEOF_DATA_PTR@") +set(CMAKE_OBJC_COMPILER_ABI "@CMAKE_OBJC_COMPILER_ABI@") +set(CMAKE_OBJC_LIBRARY_ARCHITECTURE "@CMAKE_OBJC_LIBRARY_ARCHITECTURE@") + +if(CMAKE_OBJC_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_OBJC_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_OBJC_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_OBJC_COMPILER_ABI}") +endif() + +if(CMAKE_OBJC_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_OBJC_LIBRARY_ARCHITECTURE@") +endif() + +@CMAKE_OBJC_COMPILER_CUSTOM_CODE@ +@CMAKE_OBJC_SYSROOT_FLAG_CODE@ +@CMAKE_OBJC_OSX_DEPLOYMENT_TARGET_FLAG_CODE@ + +set(CMAKE_OBJC_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_INCLUDE_DIRECTORIES@") +set(CMAKE_OBJC_IMPLICIT_LINK_LIBRARIES "@CMAKE_OBJC_IMPLICIT_LINK_LIBRARIES@") +set(CMAKE_OBJC_IMPLICIT_LINK_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_LINK_DIRECTORIES@") +set(CMAKE_OBJC_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@") |