-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support universal libraries on macOS (#11)
* Pass through multiarch * Patch boost * Build PNG from source * (opencv) Disable DNN * Don't make PNG_SHARED/STATIC exclusive * (libpng) Patch SSE fix into universal PNG code
- Loading branch information
1 parent
a0f3122
commit 478979b
Showing
6 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
option(VCDEPS_BUILD_PNG "Build libpng" ${BUILD_MACOS_MULTIARCH}) | ||
|
||
if(VCDEPS_BUILD_PNG) | ||
|
||
set(PNG_SHARED ${BUILD_SHARED_LIBS}) | ||
if(NOT PNG_SHARED) | ||
set(PNG_STATIC ON) | ||
else() | ||
set(PNG_STATIC OFF) | ||
endif() | ||
|
||
set(PNG_PATCH_CMD patch -p1 -i ${CMAKE_SOURCE_DIR}/patches/libpng-auto-sse.diff) | ||
|
||
externalproject_add( | ||
libpng | ||
DEPENDS zlib ${GLOBAL_DEPENDS} | ||
GIT_REPOSITORY https://github.com/csparker247/libpng.git | ||
GIT_TAG cmake-fix-macos-universal | ||
DOWNLOAD_NO_PROGRESS true | ||
DOWNLOAD_EXTRACT_TIMESTAMP ON | ||
PATCH_COMMAND ${PNG_PATCH_CMD} | ||
CMAKE_CACHE_ARGS | ||
${GLOBAL_CMAKE_ARGS} | ||
-DPNG_TESTS:BOOL=OFF | ||
-DPNG_TOOLS:BOOL=ON | ||
-DPNG_FRAMEWORK:BOOL=OFF | ||
-DPNG_SHARED:BOOL=${PNG_SHARED} | ||
-DPNG_STATIC:BOOL=${PNG_STATIC} | ||
) | ||
else() | ||
# Nothing to do. OpenCV will build it. | ||
add_custom_target(libpng) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using clang : ${CMAKE_OSX_DEPLOYMENT_TARGET} : clang++ : | ||
<striper> <root>"${OSX_SDK_SYSROOT}/" | ||
<target-os>"darwin" | ||
<compileflags>"-arch ${CMAKE_HOST_SYSTEM_PROCESSOR} ${BOOST_OSX_SDK}" | ||
<compileflags>"${BOOST_ARCH} ${BOOST_OSX_SDK}" | ||
<cxxflags>"-std=c++${CMAKE_CXX_STANDARD}" | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/pngpriv.h b/pngpriv.h | ||
index b59084e7e..ec27ed974 100644 | ||
--- a/pngpriv.h | ||
+++ b/pngpriv.h | ||
@@ -187,11 +187,6 @@ | ||
#endif | ||
|
||
#ifndef PNG_INTEL_SSE_OPT | ||
-# ifdef PNG_INTEL_SSE | ||
- /* Only check for SSE if the build configuration has been modified to | ||
- * enable SSE optimizations. This means that these optimizations will | ||
- * be off by default. See contrib/intel for more details. | ||
- */ | ||
# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \ | ||
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \ | ||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2) | ||
@@ -199,9 +194,6 @@ | ||
# else | ||
# define PNG_INTEL_SSE_OPT 0 | ||
# endif | ||
-# else | ||
-# define PNG_INTEL_SSE_OPT 0 | ||
-# endif | ||
#endif | ||
|
||
#if PNG_INTEL_SSE_OPT > 0 |