@@ -195,6 +195,8 @@ def get_dependencies_flags(self, deps, state, depends=None):
195
195
def generate_gir (self , state , args , kwargs ):
196
196
if len (args ) != 1 :
197
197
raise MesonException ('Gir takes one argument' )
198
+ if kwargs .get ('install_dir' ):
199
+ raise MesonException ('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"' )
198
200
girtarget = args [0 ]
199
201
while hasattr (girtarget , 'held_object' ):
200
202
girtarget = girtarget .held_object
@@ -311,7 +313,8 @@ def generate_gir(self, state, args, kwargs):
311
313
}
312
314
if kwargs .get ('install' ):
313
315
scankwargs ['install' ] = kwargs ['install' ]
314
- scankwargs ['install_dir' ] = os .path .join (state .environment .get_datadir (), 'gir-1.0' )
316
+ scankwargs ['install_dir' ] = kwargs .get ('install_dir_gir' ,
317
+ os .path .join (state .environment .get_datadir (), 'gir-1.0' ))
315
318
scan_target = GirTarget (girfile , state .subdir , scankwargs )
316
319
317
320
typelib_output = '%s-%s.typelib' % (ns , nsversion )
@@ -335,10 +338,15 @@ def generate_gir(self, state, args, kwargs):
335
338
if girdir :
336
339
typelib_cmd += ["--includedir=%s" % (girdir , )]
337
340
338
- kwargs ['output' ] = typelib_output
339
- kwargs ['command' ] = typelib_cmd
340
- kwargs ['install_dir' ] = os .path .join (state .environment .get_libdir (), 'girepository-1.0' )
341
- typelib_target = TypelibTarget (typelib_output , state .subdir , kwargs )
341
+ typelib_kwargs = {
342
+ 'output' : typelib_output ,
343
+ 'command' : typelib_cmd ,
344
+ }
345
+ if kwargs .get ('install' ):
346
+ typelib_kwargs ['install' ] = kwargs ['install' ]
347
+ typelib_kwargs ['install_dir' ] = kwargs .get ('install_dir_typelib' ,
348
+ os .path .join (state .environment .get_libdir (), 'girepository-1.0' ))
349
+ typelib_target = TypelibTarget (typelib_output , state .subdir , typelib_kwargs )
342
350
return [scan_target , typelib_target ]
343
351
344
352
def compile_schemas (self , state , args , kwargs ):
0 commit comments