@@ -60,7 +60,7 @@ def main():
60
60
)
61
61
62
62
# https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode
63
- x64 = sys .maxsize > 2 ** 32
63
+ is64 = sys .maxsize > 2 ** 32
64
64
65
65
package_name = "opencv-python"
66
66
@@ -88,7 +88,7 @@ def main():
88
88
# Path regexes with forward slashes relative to CMake install dir.
89
89
rearrange_cmake_output_data = {
90
90
"cv2" : (
91
- [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if x64 else "" )]
91
+ [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if is64 else "" )]
92
92
if os .name == "nt"
93
93
else []
94
94
)
@@ -130,7 +130,7 @@ def main():
130
130
files_outside_package_dir = {"cv2" : ["LICENSE.txt" , "LICENSE-3RD-PARTY.txt" ]}
131
131
132
132
ci_cmake_generator = (
133
- ["-G" , "Visual Studio 14" + (" Win64" if x64 else "" )]
133
+ ["-G" , "Visual Studio 14" + (" Win64" if is64 else "" )]
134
134
if os .name == "nt"
135
135
else ["-G" , "Unix Makefiles" ]
136
136
)
@@ -164,9 +164,15 @@ def main():
164
164
"-DBUILD_PNG=ON" ,
165
165
]
166
166
+ (
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
+ if platform .machine () == "ARM64" and sys .platform == "win32"
167
174
# If it is not defined 'linker flags: /machine:X86' on Windows x64
168
- ["-DCMAKE_GENERATOR_PLATFORM=x64" ]
169
- if x64 and sys .platform == "win32"
175
+ else ["-DCMAKE_GENERATOR_PLATFORM=x64" ] if is64 and sys .platform == "win32"
170
176
else []
171
177
)
172
178
+ (
@@ -186,7 +192,7 @@ def main():
186
192
"-DWITH_MSMF=OFF"
187
193
) # see: https://github.com/skvark/opencv-python/issues/263
188
194
189
- if sys .platform .startswith ("linux" ) and not x64 and "bdist_wheel" in sys .argv :
195
+ if sys .platform .startswith ("linux" ) and not is64 and "bdist_wheel" in sys .argv :
190
196
subprocess .check_call ("patch -p0 < patches/patchOpenEXR" , shell = True )
191
197
192
198
# OS-specific components during CI builds
0 commit comments