(self, target: build.Target, comp: compilers.Compiler, parameters, sources, generated_sources)
Adds the source file introspection information for a language of a target

        Internal introspection storage formart:
        self.introspection_data = {
            '<target ID>': {
                <id tuple>: {
                    'language: 'lang',
                    'compiler': ['comp', 'exe', 'list'],
                    'parameters': ['UNIQUE', 'parameter', 'list'],
                    'sources': [],
                    'generated_sources': [],
                }
            }
        }
Adds the source file introspection information for a language of a target
Adds the source file introspection information for a language of a target
def create_target_source_introspection(self, target: build.Target, comp: compilers.Compiler, parameters, sources, generated_sources):
        '''
        Adds the source file introspection information for a language of a target

        Internal introspection storage formart:
        self.introspection_data = {
            '<target ID>': {
                <id tuple>: {
                    'language: 'lang',
                    'compiler': ['comp', 'exe', 'list'],
                    'parameters': ['UNIQUE', 'parameter', 'list'],
                    'sources': [],
                    'generated_sources': [],
                }
            }
        }
        '''
        tid = target.get_id()
        lang = comp.get_language()
        tgt = self.introspection_data[tid]
        # Find an existing entry or create a new one
        id_hash = (lang, tuple(parameters))
        src_block = tgt.get(id_hash, None)
        if src_block is None:
            # Convert parameters
            if isinstance(parameters, CompilerArgs):
                parameters = parameters.to_native(copy=True)
            parameters = comp.compute_parameters_with_absolute_paths(parameters, self.build_dir)
            # The new entry
            src_block = {
                'language': lang,
                'compiler': comp.get_exelist(),
                'parameters': parameters,
                'sources': [],
                'generated_sources': [],
            }
            tgt[id_hash] = src_block
        # Make source files absolute
        sources = [x.absolute_path(self.source_dir, self.build_dir) if isinstance(x, File) else os.path.normpath(os.path.join(self.build_dir, x))
                   for x in sources]
        generated_sources = [x.absolute_path(self.source_dir, self.build_dir) if isinstance(x, File) else os.path.normpath(os.path.join(self.build_dir, x))
                             for x in generated_sources]
        # Add the source files
        src_block['sources'] += sources
        src_block['generated_sources'] += generated_sources
def create_target_source_introspection ( self , target : build . Target , comp : compilers . Compiler , parameters , sources , generated_sources ) : tid = target . get_id ( ) lang = comp . get_language ( ) tgt = self . introspection_data [ tid ] # Find an existing entry or create a new one id_hash = ( lang , tuple ( parameters ) ) src_block = tgt . get ( id_hash , None ) if src_block is None : # Convert parameters if isinstance ( parameters , CompilerArgs ) : parameters = parameters . to_native ( copy = True ) parameters = comp . compute_parameters_with_absolute_paths ( parameters , self . build_dir ) # The new entry src_block = { 'language' : lang , 'compiler' : comp . get_exelist ( ) , 'parameters' : parameters , 'sources' : [ ] , 'generated_sources' : [ ] , } tgt [ id_hash ] = src_block # Make source files absolute sources = [ x . absolute_path ( self . source_dir , self . build_dir ) if isinstance ( x , File ) else os . path . normpath ( os . path . join ( self . build_dir , x ) ) for x in sources ] generated_sources = [ x . absolute_path ( self . source_dir , self . build_dir ) if isinstance ( x , File ) else os . path . normpath ( os . path . join ( self . build_dir , x ) ) for x in generated_sources ] # Add the source files src_block [ 'sources' ] += sources src_block [ 'generated_sources' ] += generated_sources