Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f379bcc6
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f379bcc6
编写于
10月 01, 2014
作者:
M
Maksim Shabunin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Suppressed some iOS framework compilation warnings
上级
22ff1e88
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
13 deletion
+37
-13
platforms/ios/build_framework.py
platforms/ios/build_framework.py
+29
-11
platforms/ios/cmake/Modules/Platform/iOS.cmake
platforms/ios/cmake/Modules/Platform/iOS.cmake
+8
-2
未找到文件。
platforms/ios/build_framework.py
浏览文件 @
f379bcc6
...
...
@@ -25,7 +25,18 @@ The script should handle minor OpenCV updates efficiently
However, opencv2.framework directory is erased and recreated on each run.
"""
import
glob
,
re
,
os
,
os
.
path
,
shutil
,
string
,
sys
import
glob
,
re
,
os
,
os
.
path
,
shutil
,
string
,
sys
,
exceptions
,
subprocess
def
execute
(
cmd
):
try
:
print
>>
sys
.
stderr
,
"Executing:"
,
cmd
retcode
=
subprocess
.
call
(
cmd
,
shell
=
True
)
if
retcode
<
0
:
raise
Exception
(
"Child was terminated by signal:"
,
-
retcode
)
elif
retcode
>
0
:
raise
Exception
(
"Child returned:"
,
retcode
)
except
OSError
as
e
:
raise
Exception
(
"Execution failed:"
,
e
)
def
build_opencv
(
srcroot
,
buildroot
,
target
,
arch
):
"builds OpenCV for device or simulator"
...
...
@@ -48,17 +59,17 @@ def build_opencv(srcroot, buildroot, target, arch):
# if cmake cache exists, just rerun cmake to update OpenCV.xcodeproj if necessary
if
os
.
path
.
isfile
(
os
.
path
.
join
(
builddir
,
"CMakeCache.txt"
)):
os
.
system
(
"cmake %s ."
%
(
cmakeargs
,))
execute
(
"cmake %s ."
%
(
cmakeargs
,))
else
:
os
.
system
(
"cmake %s %s"
%
(
cmakeargs
,
srcroot
))
execute
(
"cmake %s %s"
%
(
cmakeargs
,
srcroot
))
for
wlib
in
[
builddir
+
"/modules/world/UninstalledProducts/libopencv_world.a"
,
builddir
+
"/lib/Release/libopencv_world.a"
]:
if
os
.
path
.
isfile
(
wlib
):
os
.
remove
(
wlib
)
os
.
system
(
"xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target ALL_BUILD"
%
(
arch
,
target
.
lower
()))
os
.
system
(
"xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 ARCHS=%s -sdk %s -configuration Release -target install install"
%
(
arch
,
target
.
lower
()))
execute
(
"xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target ALL_BUILD"
%
(
arch
,
target
.
lower
()))
execute
(
"xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 ARCHS=%s -sdk %s -configuration Release -target install install"
%
(
arch
,
target
.
lower
()))
os
.
chdir
(
currdir
)
def
put_framework_together
(
srcroot
,
dstroot
):
...
...
@@ -86,7 +97,7 @@ def put_framework_together(srcroot, dstroot):
# make universal static lib
wlist
=
" "
.
join
([
"../build/"
+
t
+
"/lib/Release/libopencv_world.a"
for
t
in
targetlist
])
os
.
system
(
"lipo -create "
+
wlist
+
" -o "
+
dstdir
+
"/opencv2"
)
execute
(
"lipo -create "
+
wlist
+
" -o "
+
dstdir
+
"/opencv2"
)
# copy Info.plist
shutil
.
copyfile
(
tdir0
+
"/ios/Info.plist"
,
dstdir
+
"/Resources/Info.plist"
)
...
...
@@ -101,10 +112,13 @@ def put_framework_together(srcroot, dstroot):
def
build_framework
(
srcroot
,
dstroot
):
"main function to do all the work"
targets
=
[
"iPhoneOS"
,
"iPhoneOS"
,
"iPhoneOS"
,
"iPhoneSimulator"
,
"iPhoneSimulator"
]
archs
=
[
"armv7"
,
"armv7s"
,
"arm64"
,
"i386"
,
"x86_64"
]
for
i
in
range
(
len
(
targets
)):
build_opencv
(
srcroot
,
os
.
path
.
join
(
dstroot
,
"build"
),
targets
[
i
],
archs
[
i
])
targets
=
[(
"armv7"
,
"iPhoneOS"
),
(
"armv7s"
,
"iPhoneOS"
),
(
"arm64"
,
"iPhoneOS"
),
(
"i386"
,
"iPhoneSimulator"
),
(
"x86_64"
,
"iPhoneSimulator"
)]
for
t
in
targets
:
build_opencv
(
srcroot
,
os
.
path
.
join
(
dstroot
,
"build"
),
t
[
1
],
t
[
0
])
put_framework_together
(
srcroot
,
dstroot
)
...
...
@@ -114,4 +128,8 @@ if __name__ == "__main__":
print
"Usage:
\n\t
./build_framework.py <outputdir>
\n\n
"
sys
.
exit
(
0
)
build_framework
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
"../.."
)),
os
.
path
.
abspath
(
sys
.
argv
[
1
]))
try
:
build_framework
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
"../.."
)),
os
.
path
.
abspath
(
sys
.
argv
[
1
]))
except
Exception
as
e
:
print
>>
sys
.
stderr
,
e
sys
.
exit
(
1
)
platforms/ios/cmake/Modules/Platform/iOS.cmake
浏览文件 @
f379bcc6
...
...
@@ -40,10 +40,16 @@ 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++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden"
)
set
(
CMAKE_CXX_FLAGS
"-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-DNDEBUG -O3 -fomit-frame-pointer -ffast-math"
)
# 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
}
"
)
if
(
HAVE_FLAG_SEARCH_PATHS_FIRST
)
set
(
CMAKE_C_LINK_FLAGS
"-Wl,-search_paths_first
${
CMAKE_C_LINK_FLAGS
}
"
)
set
(
CMAKE_CXX_LINK_FLAGS
"-Wl,-search_paths_first
${
CMAKE_CXX_LINK_FLAGS
}
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录