From 381f7f3e2eda8bc72b494e79e71b4a5a39789ccb Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tsisyk.com>
Date: Thu, 11 Jul 2013 15:39:57 +0400
Subject: [PATCH] Remove remaining references to Objective C from CMake

---
 CMakeLists.txt                      | 14 ---------
 cmake/CMakeTestOBJCCompiler.cmake   | 48 -----------------------------
 cmake/CMakeTestOBJCXXCompiler.cmake | 48 -----------------------------
 cmake/FindLibOBJC.cmake             | 18 -----------
 include/tarantool/config.h.cmake    |  3 --
 src/CMakeLists.txt                  |  5 ---
 test/box/args.test                  |  2 --
 7 files changed, 138 deletions(-)
 delete mode 100644 cmake/CMakeTestOBJCCompiler.cmake
 delete mode 100644 cmake/CMakeTestOBJCXXCompiler.cmake
 delete mode 100644 cmake/FindLibOBJC.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 594053da5d..91a29c15b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,9 +57,6 @@ endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
 
 set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/tarantool/plugins")
 
-set(CMAKE_OBJC_FLAGS)
-set(CMAKE_OBJCXX_FLAGS)
-
 include(cmake/utils.cmake)
 
 # the order is significant: we need to know os and compiler to configure libs
@@ -217,16 +214,6 @@ if (ENABLE_STATIC)
     add_compile_flags("C;CXX" "-static")
 endif()
 
-#
-# On CentOS the default gcc is way older than gcc 4.6, required
-# to compile Tarantool. To make the package compiled with gcc 4.6
-# usable on a system which has only gcc 4.1, statically link with
-# builtin libgcc by default.
-#
-#if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG)
-#    add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc")
-#endif()
-
 ##
 ## Third-Party libraries
 ##
@@ -398,7 +385,6 @@ message (STATUS "ENABLE_TRACE: ${ENABLE_TRACE}")
 message (STATUS "ENABLE_BACKTRACE: ${ENABLE_BACKTRACE} (symbol resolve: ${HAVE_BFD})")
 message (STATUS "ENABLE_CLIENT: ${ENABLE_CLIENT}")
 message (STATUS "ENABLE_BUNDLED_LUAJIT: ${ENABLE_BUNDLED_LUAJIT}")
-message (STATUS "ENABLE_BUNDLED_LIBOBJC: ${ENABLE_BUNDLED_LIBOBJC}")
 message (STATUS "ENABLE_BUNDLED_LIBEV: ${ENABLE_BUNDLED_LIBEV}")
 message (STATUS "ENABLE_BUNDLED_LIBEIO: ${ENABLE_BUNDLED_LIBEIO}")
 message (STATUS "ENABLE_BUNDLED_LIBCORO: ${ENABLE_BUNDLED_LIBCORO}")
diff --git a/cmake/CMakeTestOBJCCompiler.cmake b/cmake/CMakeTestOBJCCompiler.cmake
deleted file mode 100644
index ae9a403385..0000000000
--- a/cmake/CMakeTestOBJCCompiler.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Check if C compiler can compile ObjectiveC sources.
-# The code was borrowed from CMakeTestCXXCompiler.cmake
-#
-
-if(CMAKE_OBJC_COMPILER_FORCED OR CMAKE_C_COMPILER_FORCED)
-  # The compiler configuration was forced by the user.
-  # Assume the user has configured all compiler information.
-  set(CMAKE_OBJC_COMPILER_WORKS TRUE)
-  return()
-endif()
-
-if(NOT CMAKE_OBJC_COMPILER_WORKS)
-  message(STATUS "Check for working ObjectiveC compiler: ${CMAKE_C_COMPILER}")
-  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
-    "#if !defined(__OBJC__)\n"
-    "# error \"The CMAKE_C_COMPILER doesn't support ObjectiveC\"\n"
-    "#endif\n"
-    "int main(){return 0;}\n")
-  try_compile(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_BINARY_DIR} 
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
-    OUTPUT_VARIABLE __CMAKE_OBJC_COMPILER_OUTPUT)
-  # Move result from cache to normal variable.
-  set(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_OBJC_COMPILER_WORKS})
-  set(OBJC_TEST_WAS_RUN 1)
-endif()
-
-if(NOT CMAKE_OBJC_COMPILER_WORKS)
-  message(STATUS "Check for working ObjectiveC compiler: "
-    "${CMAKE_C_COMPILER}" " -- broken")
-  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-    "Determining if the ObjectiveC compiler works failed with "
-    "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n")
-  message(FATAL_ERROR "The ObjectiveC compiler \"${CMAKE_C_COMPILER}\" "
-    "is not able to compile a simple ObjectiveC test program.\nIt fails "
-    "with the following output:\n ${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n"
-    "CMake will not be able to correctly generate this project.")
-else()
-  if(OBJC_TEST_WAS_RUN)
-    message(STATUS "Check for working ObjectiveC compiler: "
-        "${CMAKE_C_COMPILER}" " -- works")
-    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-      "Determining if the ObjectiveC compiler works passed with "
-      "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n")
-  endif()
-endif()
-
-unset(__CMAKE_OBJC_COMPILER_OUTPUT)
diff --git a/cmake/CMakeTestOBJCXXCompiler.cmake b/cmake/CMakeTestOBJCXXCompiler.cmake
deleted file mode 100644
index 2d77c46046..0000000000
--- a/cmake/CMakeTestOBJCXXCompiler.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Check if CXX compiler can compile ObjectiveC sources.
-# The code was borrowed from CMakeTestCXXCompiler.cmake
-#
-
-if(CMAKE_OBJCXX_COMPILER_FORCED OR CMAKE_CXX_COMPILER_FORCED)
-  # The compiler configuration was forced by the user.
-  # Assume the user has configured all compiler information.
-  set(CMAKE_OBJCXX_COMPILER_WORKS TRUE)
-  return()
-endif()
-
-if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
-  message(STATUS "Check for working ObjectiveC++ compiler: ${CMAKE_CXX_COMPILER}")
-  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
-    "#if !defined(__OBJC__) || !defined(__cplusplus)\n"
-    "# error \"The CMAKE_CXX_COMPILER doesn't support ObjectiveC++\"\n"
-    "#endif\n"
-    "int main(){return 0;}\n")
-  try_compile(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_BINARY_DIR} 
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
-    OUTPUT_VARIABLE __CMAKE_OBJCXX_COMPILER_OUTPUT)
-  # Move result from cache to normal variable.
-  set(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_OBJCXX_COMPILER_WORKS})
-  set(OBJCXX_TEST_WAS_RUN 1)
-endif()
-
-if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
-  message(STATUS "Check for working ObjectiveC++ compiler: "
-    "${CMAKE_CXX_COMPILER}" " -- broken")
-  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-    "Determining if the ObjectiveC++ compiler works failed with "
-    "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n")
-  message(FATAL_ERROR "The ObjectiveC++ compiler \"${CMAKE_CXX_COMPILER}\" "
-    "is not able to compile a simple ObjectiveC++ test program.\nIt fails "
-    "with the following output:\n ${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n"
-    "CMake will not be able to correctly generate this project.")
-else()
-  if(OBJCXX_TEST_WAS_RUN)
-    message(STATUS "Check for working ObjectiveC++ compiler: "
-        "${CMAKE_CXX_COMPILER}" " -- works")
-    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-      "Determining if the ObjectiveC++ compiler works passed with "
-      "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n")
-  endif()
-endif()
-
-unset(__CMAKE_OBJCXX_COMPILER_OUTPUT)
diff --git a/cmake/FindLibOBJC.cmake b/cmake/FindLibOBJC.cmake
deleted file mode 100644
index 7140c8e8d9..0000000000
--- a/cmake/FindLibOBJC.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# Current we are not support GNUstep libraries
-find_path(LIBOBJC_INCLUDE_DIR NAMES objc/Object.h)
-find_library(LIBOBJC_LIBRARIES NAMES objc)
-
-if(LIBOBJC_INCLUDE_DIR AND LIBOBJC_LIBRARIES)
-    set(LIBOBJC_FOUND ON)
-endif(LIBOBJC_INCLUDE_DIR AND LIBOBJC_LIBRARIES)
-
-if(LIBOBJC_FOUND)
-    if (NOT LIBOBJC_FIND_QUIETLY)
-        message(STATUS "Found libobjc includes: ${LIBOBJC_INCLUDE_DIR}/objc")
-        message(STATUS "Found libobjc library: ${LIBOBJC_LIBRARIES}")
-    endif (NOT LIBOBJC_FIND_QUIETLY)
-else(LIBOBJC_FOUND)
-    if (LIBOBJC_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find libobjc development files")
-    endif (LIBOBJC_FIND_REQUIRED)
-endif (LIBOBJC_FOUND)
diff --git a/include/tarantool/config.h.cmake b/include/tarantool/config.h.cmake
index fd495fecc4..d7d4bec5da 100644
--- a/include/tarantool/config.h.cmake
+++ b/include/tarantool/config.h.cmake
@@ -93,7 +93,6 @@
  */
 #cmakedefine HAVE_NON_C99_PTHREAD_H 1
 
-#cmakedefine ENABLE_BUNDLED_LIBOBJC 1
 #cmakedefine ENABLE_BUNDLED_LIBEV 1
 #cmakedefine ENABLE_BUNDLED_LIBEIO 1
 #cmakedefine ENABLE_BUNDLED_LIBCORO 1
@@ -109,8 +108,6 @@
 #define COMPILER_INFO "@CMAKE_C_COMPILER@ @CMAKE_CXX_COMPILER@"
 #define TARANTOOL_C_FLAGS "@TARANTOOL_C_FLAGS@"
 #define TARANTOOL_CXX_FLAGS "@TARANTOOL_CXX_FLAGS@"
-#define TARANTOOL_OBJC_FLAGS "@TARANTOOL_OBJC_FLAGS@"
-#define TARANTOOL_OBJCXX_FLAGS "@TARANTOOL_OBJCXX_FLAGS@"
 #define LUA_SYSPATH "@LUA_SYSPATH@"
 #define LUA_SYSCPATH "@LUA_SYSCPATH@"
 #define LUA_LIBPATH "@LUA_LIBPATH@"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index efd1e2b148..f7c69ac258 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,9 +11,6 @@ include_directories(${LIBEV_INCLUDE_DIR})
 include_directories(${LIBEIO_INCLUDE_DIR})
 include_directories(${LIBCORO_INCLUDE_DIR})
 include_directories(${LIBGOPT_INCLUDE_DIR})
-if (ENABLE_BUNDLED_LIBOBJC)
-    include_directories(${LIBOBJC_INCLUDE_DIR})
-endif()
 
 # Require pthread globally if compiling with GCC
 if (CMAKE_COMPILER_IS_GNUCC)
@@ -179,8 +176,6 @@ add_subdirectory(lib)
 # Save CMAKE_XXX_FLAGS from this directory for config.h (used in --version)
 set(TARANTOOL_C_FLAGS ${CMAKE_C_FLAGS} PARENT_SCOPE)
 set(TARANTOOL_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
-set(TARANTOOL_OBJC_FLAGS ${CMAKE_OBJC_FLAGS} PARENT_SCOPE)
-set(TARANTOOL_OBJCXX_FLAGS ${CMAKE_OBJCXX_FLAGS} PARENT_SCOPE)
 
 function(tarantool_module mod)
     set (module_sources ${ARGN})
diff --git a/test/box/args.test b/test/box/args.test
index 56847962f9..433a4e6d73 100644
--- a/test/box/args.test
+++ b/test/box/args.test
@@ -34,8 +34,6 @@ sys.stdout.push_filter("Target: .*", "Target: platform <build>")
 sys.stdout.push_filter("Build options: .*", "Build options: flags")
 sys.stdout.push_filter("C_FLAGS:.*", "C_FLAGS: flags")
 sys.stdout.push_filter("CXX_FLAGS:.*", "CXX_FLAGS: flags")
-sys.stdout.push_filter("OBJC_FLAGS:.*", "OBJC_FLAGS: flags")
-sys.stdout.push_filter("OBJCXX_FLAGS:.*", "OBJCXX_FLAGS: flags")
 sys.stdout.push_filter("Compiler: .*", "Compiler: cc")
 
 server.test_option("--version")
-- 
GitLab