Beispiel #1
0
 def scan(self):
     (nodes, names) = c_preproc.scan(self)
     for x in nodes:
         if x.name.endswith('.moc'):
             nodes.remove(x)
             names.append(x.path_from(self.inputs[0].parent.get_bld()))
     return (nodes, names)
Beispiel #2
0
	def scan(self):
		(nodes,names)=c_preproc.scan(self)
		for x in nodes:
			if x.name.endswith('.moc'):
				nodes.remove(x)
				names.append(x.path_from(self.inputs[0].parent.get_bld()))
		return(nodes,names)
    def scan(self):
        """
        Re-use the C/C++ scanner, but only on the given header file
        """
        # Does this even work with headers?
        dependencies = c_preproc.scan(self)

        # Add everything in the azcg folder as a dependency
        azcg_dir = self.env['CODE_GENERATOR_PATH'][0]
        azcg_dir_node = self.generator.bld.root.find_node(azcg_dir)
        if azcg_dir_node:
            azcg_dep_nodes = azcg_dir_node.ant_glob('**/*')
            dependencies[0].extend(azcg_dep_nodes)
        else:
            Logs.warn(
                'az_code_gen: Unable to find azcg directory. Code Generator tasks will not have the utility/scripts as dependencies'
            )

        # this script is a dependency
        script_relpath = os.path.relpath(__file__,
                                         self.generator.bld.root.abspath())
        script_node = self.generator.bld.root.find_node(script_relpath)
        dependencies[0].append(script_node)

        # all codegen scripts are deps
        for script in self.scripts:
            script_node = self.path.find_or_declare(script)
            dependencies[0].append(script_node)

        # any dependencies from last run that were stored
        script_deps = self.azcg_get('script_deps', [])
        dependencies[0].extend(script_deps)

        return dependencies
Beispiel #4
0
 def scan(self):
     selfile = self.env['GENREFLEX_SELECTION']
     node = self.generator.bld.root.find_resource(selfile)
     c_nodes, c_names = c_preproc.scan(self)
     c_nodes.append(node)
     c_names.append(waflib.Utils.h_file(node.abspath()))
     return (c_nodes, c_names)
Beispiel #5
0
    def scan(self):
        if self.env.ASM_NAME == 'gas':
            return c_preproc.scan(self)
            Logs.warn('There is no dependency scanner for Nasm!')
            return [[], []]
        elif self.env.ASM_NAME == 'nasm':
            Logs.warn('The Nasm dependency scanner is incomplete!')

        try:
            incn = self.generator.includes_nodes
        except AttributeError:
            raise Errors.WafError('%r is missing the "asm" feature' %
                                  self.generator)

        if c_preproc.go_absolute:
            nodepaths = incn
        else:
            nodepaths = [
                x for x in incn
                if x.is_child_of(x.ctx.srcnode) or x.is_child_of(x.ctx.bldnode)
            ]

        tmp = asm_parser(nodepaths)
        tmp.start(self.inputs[0], self.env)
        return (tmp.nodes, tmp.names)
Beispiel #6
0
    def scan(self):
        # pxc files are C-like files: call standard C preprocessor
        (deps, raw) = c_preproc.scan(self)

        # pxc files must be rebuilt when pxcc changes
        deps.append(self.inputs[0].ctx.pxcc_tgen.link_task.outputs[0])

        return (deps, raw)
    def wrap_c_preproc_scan(task):
        def get_node_from_abspath(ctx, path):
            return ctx.root.make_node(path)

        (nodes, names) = c_preproc.scan(task)
        if 'pebble.h' in names:
            nodes.append(get_node_from_abspath(task.generator.bld, task.env.RESOURCE_ID_HEADER))
        return (nodes, names)
Beispiel #8
0
	def scan(self):
		"""Re-use the C/C++ scanner, but remove the moc files from the dependencies"""
		(nodes, names) = c_preproc.scan(self)
		# for some reasons (variants) the moc node may end in the list of node deps
		for x in nodes:
			if x.name.endswith('.moc'):
				nodes.remove(x)
				names.append(x.path_from(self.inputs[0].parent.get_bld()))
		return (nodes, names)
Beispiel #9
0
 def scan(self):
     """Re-use the C/C++ scanner, but remove the moc files from the dependencies"""
     (nodes, names) = c_preproc.scan(self)
     # for some reasons (variants) the moc node may end in the list of node deps
     for x in nodes:
         if x.name.endswith('.moc'):
             nodes.remove(x)
             names.append(x.path_from(self.inputs[0].parent.get_bld()))
     return (nodes, names)
Beispiel #10
0
	def scan(self):
		"""re-use the c/c++ scanner, but process moc files in a different way"""
		(nodes, names) = c_preproc.scan(self)
		# for some reasons (variants) the moc node may end in the list of node deps
		for x in nodes:
			if x.name.endswith('.moc'):
				nodes.remove(x)
				names.append(x.path_from(self.inputs[0].parent.get_bld()))
		return (nodes, names)
Beispiel #11
0
	def scan(self):
		(nodes,names)=c_preproc.scan(self)
		lst=[]
		for x in nodes:
			if x.name.endswith('.moc'):
				s=x.path_from(self.inputs[0].parent.get_bld())
				if s not in names:
					names.append(s)
			else:
				lst.append(x)
		return(lst,names)
Beispiel #12
0
    def scan(self):
        c_nodes, c_names = c_preproc.scan(self)
        linkdef = self.env['ROOTCINT_LINKDEF']
        linkdef_node = self.generator.bld.root.find_resource(linkdef)
        c_nodes.append(linkdef_node)
        c_names.append(waflib.Utils.h_file(linkdef_node.abspath()))

        src_node = self.inputs[0]
        c_nodes.append(src_node)
        c_names.append(waflib.Utils.h_file(src_node.abspath()))
        return (c_nodes, c_names)
Beispiel #13
0
    def scan(self):
        """
		Re-use the C/C++ scanner, but remove the moc files from the dependencies
		since the .cpp file already depends on all the headers
		"""
        (nodes, names) = c_preproc.scan(self)
        lst = []
        for x in nodes:
            # short lists, no need to use sets
            if x.name.endswith('.moc'):
                s = x.path_from(self.inputs[0].parent.get_bld())
                if s not in names:
                    names.append(s)
            else:
                lst.append(x)
        return (lst, names)
	def scan(self):
		"""
		Re-use the C/C++ scanner, but remove the moc files from the dependencies
		since the .cpp file already depends on all the headers
		"""
		(nodes, names) = c_preproc.scan(self)
		lst = []
		for x in nodes:
			# short lists, no need to use sets
			if x.name.endswith('.moc'):
				s = x.path_from(self.inputs[0].parent.get_bld())
				if s not in names:
					names.append(s)
			else:
				lst.append(x)
		return (lst, names)
Beispiel #15
0
    def scanner(task):
        (nodes, names) = c_preproc.scan(task)
        nodes2 = list(nodes)
        for x in nodes:

            try:
                content = open(x.get_src().abspath(), 'r').read()
                for m in re.finditer('OPA_RESOURCE_DECL\(\w+,\s*"([^"]+)"\)',
                                     content):
                    fil = m.group(1)
                    for inc in task.generator.includes_nodes:
                        res = inc.find_node(fil)
                        if res:
                            nodes2.append(res)
                            break

            except:
                tb.print_exc()

        return (nodes2, names)
	def scan(self):
		"""
		Re-use the C/C++ scanner, but remove the moc files from the dependencies
		since the .cpp file already depends on all the headers
		"""		
		return c_preproc.scan(self)