From 3d0c08816d3fc3f74c9b25f69eeaac41dca9160b Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 1 Nov 2012 18:15:48 +0400 Subject: [PATCH] another fix to make OpenCV more friendly for iOS developers. We now use libc++ instead of libstdc++ and clang instead of gcc to build opencv2.framework. --- ios/build_framework.py | 6 +++--- ios/cmake/Modules/Platform/iOS.cmake | 2 +- ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake | 4 ++-- ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/build_framework.py b/ios/build_framework.py index 11d9a212764e..3f0e85f725c6 100755 --- a/ios/build_framework.py +++ b/ios/build_framework.py @@ -13,16 +13,16 @@ build/ - iPhoneOS/ + iPhoneOS-*/ [cmake-generated build tree for an iOS device target] iPhoneSimulator/ [cmake-generated build tree for iOS simulator] - OpenCV.framework/ + opencv2.framework/ [the framework content] The script should handle minor OpenCV updates efficiently - it does not recompile the library from scratch each time. -However, OpenCV.framework directory is erased and recreated on each run. +However, opencv2.framework directory is erased and recreated on each run. """ import glob, re, os, os.path, shutil, string, sys diff --git a/ios/cmake/Modules/Platform/iOS.cmake b/ios/cmake/Modules/Platform/iOS.cmake index 9d6ab80913ad..4d196e65d99a 100644 --- a/ios/cmake/Modules/Platform/iOS.cmake +++ b/ios/cmake/Modules/Platform/iOS.cmake @@ -40,7 +40,7 @@ set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") # Hidden visibilty is required for cxx on iOS set (CMAKE_C_FLAGS "") -set (CMAKE_CXX_FLAGS "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden") +set (CMAKE_CXX_FLAGS "-stdlib=libc++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden") set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math") diff --git a/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake b/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake index aa3a67cdbd0e..67343253bda4 100644 --- a/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake +++ b/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake @@ -8,8 +8,8 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/ios/cma # Force the compilers to gcc for iOS include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER (gcc gcc) -CMAKE_FORCE_CXX_COMPILER (g++ g++) +#CMAKE_FORCE_C_COMPILER (gcc gcc) +#CMAKE_FORCE_CXX_COMPILER (g++ g++) set (CMAKE_C_SIZEOF_DATA_PTR 4) set (CMAKE_C_HAS_ISYSROOT 1) diff --git a/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake b/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake index 78d45bca18e9..7ef8113edbd6 100644 --- a/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake +++ b/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake @@ -8,8 +8,8 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/ios/cma # Force the compilers to gcc for iOS include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER (gcc gcc) -CMAKE_FORCE_CXX_COMPILER (g++ g++) +#CMAKE_FORCE_C_COMPILER (gcc gcc) +#CMAKE_FORCE_CXX_COMPILER (g++ g++) set (CMAKE_C_SIZEOF_DATA_PTR 4) set (CMAKE_C_HAS_ISYSROOT 1)