(self, node, args, kwargs)
return tg
Implementation-only, without FeatureNew checks, for internal use
Implementation-only, without FeatureNew checks, for internal use
Implementation - only without FeatureNew checks for internal use
def _func_custom_target_impl(self, node, args, kwargs):
        'Implementation-only, without FeatureNew checks, for internal use'
        name = args[0]
        if name is None:
            # name will default to first output, but we cannot do that yet because
            # they could need substitutions (e.g. @BASENAME@) first. CustomTarget()
            # will take care of setting a proper default but name must be an empty
            # string in the meantime.
            FeatureNew('custom_target() with no name argument', '0.60.0', location=node).use(self.subproject)
            name = ''
        kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
        if 'input' in kwargs:
            kwargs['input'] = self.source_strings_to_files(extract_as_list(kwargs, 'input'), strict=False)
        kwargs['env'] = self.unpack_env_kwarg(kwargs)
        if 'command' in kwargs and isinstance(kwargs['command'], list) and kwargs['command']:
            if isinstance(kwargs['command'][0], str):
                kwargs['command'][0] = self.find_program_impl([kwargs['command'][0]])
        tg = build.CustomTarget(name, self.subdir, self.subproject, kwargs, backend=self.backend)
        self.add_target(tg.name, tg)
        return tg
def _func_custom_target_impl ( self , node , args , kwargs ) : name = args [ 0 ] if name is None : # name will default to first output, but we cannot do that yet because # they could need substitutions (e.g. @BASENAME@) first. CustomTarget() # will take care of setting a proper default but name must be an empty # string in the meantime. FeatureNew ( 'custom_target() with no name argument' , '0.60.0' , location = node ) . use ( self . subproject ) name = '' kwargs [ 'install_mode' ] = self . _get_kwarg_install_mode ( kwargs ) if 'input' in kwargs : kwargs [ 'input' ] = self . source_strings_to_files ( extract_as_list ( kwargs , 'input' ) , strict = False ) kwargs [ 'env' ] = self . unpack_env_kwarg ( kwargs ) if 'command' in kwargs and isinstance ( kwargs [ 'command' ] , list ) and kwargs [ 'command' ] : if isinstance ( kwargs [ 'command' ] [ 0 ] , str ) : kwargs [ 'command' ] [ 0 ] = self . find_program_impl ( [ kwargs [ 'command' ] [ 0 ] ] ) tg = build . CustomTarget ( name , self . subdir , self . subproject , kwargs , backend = self . backend ) self . add_target ( tg . name , tg ) return tg