Browse Source

cmake: on Apple, check for presence of an OBJC compiler

Anonymous Maarten 2 years ago
parent
commit
61297f703a
2 changed files with 8 additions and 0 deletions
  1. 1 0
      CMakeLists.txt
  2. 7 0
      cmake/macros.cmake

+ 1 - 0
CMakeLists.txt

@@ -58,6 +58,7 @@ endif()
 include(CheckLibraryExists)
 include(CheckIncludeFiles)
 include(CheckIncludeFile)
+include(CheckLanguage)
 include(CheckSymbolExists)
 include(CheckCSourceCompiles)
 include(CheckCSourceRuns)

+ 7 - 0
cmake/macros.cmake

@@ -110,6 +110,13 @@ else()
   endif()
 endif()
 
+if(APPLE)
+  check_language(OBJC)
+  if(NOT CMAKE_OBJC_COMPILER)
+    message(WARNING "Cannot find working OBJC compiler.")
+  endif()
+endif()
+
 if(CMAKE_VERSION VERSION_LESS 3.13.0)
   macro(target_link_directories _TARGET _SCOPE)
     link_directories(${ARGN})