Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5de8d66

Browse files
authored
Merge pull request#644 from nsait-linaro/windows-arm64
add support for building windows/arm64 package
2 parents8f2049e +7419f58 commit5de8d66

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

‎setup.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main():
6060
)
6161

6262
# https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode
63-
x64=sys.maxsize>2**32
63+
is64=sys.maxsize>2**32
6464

6565
package_name="opencv-python"
6666

@@ -88,7 +88,7 @@ def main():
8888
# Path regexes with forward slashes relative to CMake install dir.
8989
rearrange_cmake_output_data= {
9090
"cv2": (
91-
[r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll"% ("_64"ifx64else"")]
91+
[r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll"% ("_64"ifis64else"")]
9292
ifos.name=="nt"
9393
else []
9494
)
@@ -130,7 +130,7 @@ def main():
130130
files_outside_package_dir= {"cv2": ["LICENSE.txt","LICENSE-3RD-PARTY.txt"]}
131131

132132
ci_cmake_generator= (
133-
["-G","Visual Studio 14"+ (" Win64"ifx64else"")]
133+
["-G","Visual Studio 14"+ (" Win64"ifis64else"")]
134134
ifos.name=="nt"
135135
else ["-G","Unix Makefiles"]
136136
)
@@ -164,9 +164,15 @@ def main():
164164
"-DBUILD_PNG=ON",
165165
]
166166
+ (
167+
# CMake flags for windows/arm64 build
168+
["-DCMAKE_GENERATOR_PLATFORM=ARM64",
169+
# Emulated cmake requires following flags to correctly detect
170+
# target architecture for windows/arm64 build
171+
"-DOPENCV_WORKAROUND_CMAKE_20989=ON",
172+
"-DCMAKE_SYSTEM_PROCESSOR=ARM64"]
173+
ifplatform.machine()=="ARM64"andsys.platform=="win32"
167174
# If it is not defined 'linker flags: /machine:X86' on Windows x64
168-
["-DCMAKE_GENERATOR_PLATFORM=x64"]
169-
ifx64andsys.platform=="win32"
175+
else ["-DCMAKE_GENERATOR_PLATFORM=x64"]ifis64andsys.platform=="win32"
170176
else []
171177
)
172178
+ (
@@ -186,7 +192,7 @@ def main():
186192
"-DWITH_MSMF=OFF"
187193
)# see: https://github.com/skvark/opencv-python/issues/263
188194

189-
ifsys.platform.startswith("linux")andnotx64and"bdist_wheel"insys.argv:
195+
ifsys.platform.startswith("linux")andnotis64and"bdist_wheel"insys.argv:
190196
subprocess.check_call("patch -p0 < patches/patchOpenEXR",shell=True)
191197

192198
# OS-specific components during CI builds

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp