Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
another fix to make OpenCV more friendly for iOS developers. We now u…
…se libc++ instead of libstdc++ and clang instead of gcc to build opencv2.framework.
  • Loading branch information
Vadim Pisarevsky committed Nov 1, 2012
1 parent d9d4e8d commit 3d0c088
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ios/build_framework.py
Expand Up @@ -13,16 +13,16 @@
<outputdir>
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
Expand Down
2 changes: 1 addition & 1 deletion ios/cmake/Modules/Platform/iOS.cmake
Expand Up @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake
Expand Up @@ -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)
Expand Down

0 comments on commit 3d0c088

Please sign in to comment.