@@ -19,7 +19,7 @@ def execute(cmd, shell=False):
19
19
elif retcode > 0 :
20
20
raise Fail ("Child returned: %s" % retcode )
21
21
except OSError as e :
22
- raise Fail ("Execution failed: %s" % e . strerror )
22
+ raise Fail ("Execution failed: %d / % s" % ( e . errno , e . strerror ) )
23
23
24
24
def rm_one (d ):
25
25
d = os .path .abspath (d )
@@ -169,18 +169,23 @@ def build_engine(self, abi, engdest):
169
169
for ver , d in self .extra_packs + [("3.0.0" , os .path .join (self .libdest , "lib" ))]:
170
170
r = ET .Element ("library" , attrib = {"version" : ver })
171
171
log .info ("Adding libraries from %s" , d )
172
+
172
173
for f in glob .glob (os .path .join (d , abi .name , "*.so" )):
173
174
log .info ("Copy file: %s" , f )
174
175
shutil .copy2 (f , apklibdest )
175
176
if "libnative_camera" in f :
176
177
continue
177
178
log .info ("Register file: %s" , os .path .basename (f ))
178
179
n = ET .SubElement (r , "file" , attrib = {"name" : os .path .basename (f )})
179
- xmlname = os .path .join (apkxmldest , "config%s.xml" % ver .replace ("." , "" ))
180
- log .info ("Generating XML config: %s" , xmlname )
181
- ET .ElementTree (r ).write (xmlname , encoding = "utf-8" )
180
+
181
+ if len (list (r )) > 0 :
182
+ xmlname = os .path .join (apkxmldest , "config%s.xml" % ver .replace ("." , "" ))
183
+ log .info ("Generating XML config: %s" , xmlname )
184
+ ET .ElementTree (r ).write (xmlname , encoding = "utf-8" )
185
+
182
186
execute (["ninja" , "opencv_engine" ])
183
- execute (["ant" , "-f" , os .path .join (apkdest , "build.xml" ), "debug" ], shell = True )
187
+ execute (["ant" , "-f" , os .path .join (apkdest , "build.xml" ), "debug" ],
188
+ shell = (sys .platform == 'win32' ))
184
189
# TODO: Sign apk
185
190
186
191
def build_javadoc (self ):
0 commit comments