Fixing iOS clang warnings, part 3

pull/3292/head
Maksim Shabunin 11 years ago
parent ef3d02214b
commit 571ebb2373
  1. 2
      3rdparty/zlib/CMakeLists.txt
  2. 4
      cmake/OpenCVCompilerOptions.cmake
  3. 4
      cmake/OpenCVUtils.cmake
  4. 3
      modules/imgcodecs/src/grfmt_tiff.cpp
  5. 4
      modules/videoio/src/cap_ios_abstract_camera.mm
  6. 2
      modules/videoio/src/cap_ios_video_camera.mm
  7. 13
      platforms/ios/cmake/Modules/Platform/iOS.cmake

@ -82,7 +82,7 @@ if(UNIX)
endif()
endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
ocv_warnings_disable(CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations)
set_target_properties(${ZLIB_LIBRARY} PROPERTIES
OUTPUT_NAME ${ZLIB_LIBRARY}

@ -106,6 +106,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-march=i686)
endif()
if(APPLE)
add_extra_compiler_option(-Wno-semicolon-before-method-body)
endif()
# Other optimizations
if(ENABLE_OMIT_FRAME_POINTER)
add_extra_compiler_option(-fomit-frame-pointer)

@ -249,9 +249,9 @@ macro(add_apple_compiler_options the_module)
if("${source}" MATCHES "\\.mm$")
get_source_file_property(flags "${source}" COMPILE_FLAGS)
if(flags)
set(flags "${_flags} -fobjc-exceptions -Wno-semicolon-before-method-body")
set(flags "${_flags} -fobjc-exceptions")
else()
set(flags "-fobjc-exceptions -Wno-semicolon-before-method-body")
set(flags "-fobjc-exceptions")
endif()
set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}")

@ -52,10 +52,11 @@
namespace cv
{
static const char fmtSignTiffII[] = "II\x2a\x00";
static const char fmtSignTiffMM[] = "MM\x00\x2a";
#ifdef HAVE_TIFF
static const char fmtSignTiffMM[] = "MM\x00\x2a";
#include "tiff.h"
#include "tiffio.h"

@ -150,7 +150,7 @@
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[super dealloc]
[super dealloc];
}
@ -244,7 +244,7 @@
default:
break;
}
NSLog(@"deviceOrientationDidChange: %d", orientation);
NSLog(@"deviceOrientationDidChange: %d", (int)orientation);
[self updateOrientation];
}

@ -464,7 +464,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
}
// delegate image processing to the delegate
cv::Mat image(height, width, format_opencv, bufferAddress, bytesPerRow);
cv::Mat image((int)height, (int)width, format_opencv, bufferAddress, bytesPerRow);
CGImage* dstImage;

@ -39,16 +39,11 @@ set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSI
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 "-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden")
set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math")
set (no_warn "-Wno-unused-function -Wno-overloaded-virtual")
set (CMAKE_C_FLAGS "${no_warn}")
set (CMAKE_CXX_FLAGS "-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden ${no_warn}")
# Silence some warnings
set (no_warn "-Wno-unused-function -Wno-unused-parameter -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-const-variable -Wno-overloaded-virtual")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${no_warn}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${no_warn}")
# Additional linker flag
set (CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names ${CMAKE_CXX_LINK_FLAGS}")
set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math")
if (HAVE_FLAG_SEARCH_PATHS_FIRST)
set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")

Loading…
Cancel
Save