Esempio n. 1
0
def check_waf_version(self,mini='1.6.99',maxi='1.8.0'):
	self.start_msg('Checking for waf version in %s-%s'%(str(mini),str(maxi)))
	ver=Context.HEXVERSION
	if Utils.num2ver(mini)>ver:
		self.fatal('waf version should be at least %r (%r found)'%(Utils.num2ver(mini),ver))
	if Utils.num2ver(maxi)<ver:
		self.fatal('waf version should be at most %r (%r found)'%(Utils.num2ver(maxi),ver))
	self.end_msg('ok')
Esempio n. 2
0
def check_waf_version(self, mini="1.6.99", maxi="1.8.0"):
    self.start_msg("Checking for waf version in %s-%s" % (str(mini), str(maxi)))
    ver = Context.HEXVERSION
    if Utils.num2ver(mini) > ver:
        self.fatal("waf version should be at least %r (%r found)" % (Utils.num2ver(mini), ver))
    if Utils.num2ver(maxi) < ver:
        self.fatal("waf version should be at most %r (%r found)" % (Utils.num2ver(maxi), ver))
    self.end_msg("ok")
Esempio n. 3
0
def _check_min_version(cfg):
    cfg.start_msg('Checking cmake version')
    cmd = cfg.env.get_flat('CMAKE'), '--version'
    out = cfg.cmd_and_log(cmd, quiet=Context.BOTH)
    m = re.search(r'\d+\.\d+(\.\d+(\.\d+)?)?', out)
    if not m:
        cfg.end_msg(
            'unable to parse version, build is not guaranteed to succeed',
            color='YELLOW',
        )
    else:
        version = Utils.num2ver(m.group(0))
        minver_str = cfg.env.get_flat('CMAKE_MIN_VERSION')
        minver = Utils.num2ver(minver_str)
        if version < minver:
            cfg.fatal('cmake must be at least at version %s' % minver_str)
        cfg.end_msg(m.group(0))
Esempio n. 4
0
def check_waf_version(self, mini='1.7.99', maxi='1.9.0', **kw):
	"""
	Raise a Configuration error if the Waf version does not strictly match the given bounds::

		conf.check_waf_version(mini='1.8.0', maxi='1.9.0')

	:type  mini: number, tuple or string
	:param mini: Minimum required version
	:type  maxi: number, tuple or string
	:param maxi: Maximum allowed version
	"""
	self.start_msg('Checking for waf version in %s-%s' % (str(mini), str(maxi)), **kw)
	ver = Context.HEXVERSION
	if Utils.num2ver(mini) > ver:
		self.fatal('waf version should be at least %r (%r found)' % (Utils.num2ver(mini), ver))
	if Utils.num2ver(maxi) < ver:
		self.fatal('waf version should be at most %r (%r found)' % (Utils.num2ver(maxi), ver))
	self.end_msg('ok', **kw)
Esempio n. 5
0
def check_waf_version(self, mini='1.6.0', maxi='1.7.0'):
	"""
	check for the waf version

	Versions should be supplied as hex. 0x01000000 means 1.0.0,
	0x010408 means 1.4.8, etc.

	:type  mini: number, tuple or string
	:param mini: Minimum required version
	:type  maxi: number, tuple or string
	:param maxi: Maximum allowed version
	"""
	self.start_msg('Checking for waf version in %s-%s' % (str(mini), str(maxi)))
	ver = Context.HEXVERSION
	if Utils.num2ver(mini) > ver:
		self.fatal('waf version should be at least %r (%r found)' % (Utils.num2ver(mini), ver))

	if Utils.num2ver(maxi) < ver:
		self.fatal('waf version should be at most %r (%r found)' % (Utils.num2ver(maxi), ver))
	self.end_msg('ok')
Esempio n. 6
0
        exe_path = get_quoted_path(output_node),
        resource_id = resource_id)

    # CALL THE MANIFEST TOOL.
    manifest_tool_result = parent_task.exec_command(manifest_tool_command)
    return manifest_tool_result


# The C++ header files cannot be compiled. They are ignored here to that they
# are not further processed by Waf.
@extension('.h')
def IgnoreHeaderFiles(project, node):
    pass

# Patch older versions of waf where the preprocessor's cache is sized too small by default.
if Utils.num2ver('1.9.7') > Context.HEXVERSION:
    Logs.warn('Please upgrade to waf 1.9.7 for improved performance!')
    
    # Monkey-patch the built-in cached_find_resource method for Waf's custom preprocessor. In waf version 
    # 1.9, the node cache was changed from a dict to an LRU cache in order to reduce memory consumption 
    # (see https://github.com/waf-project/waf/commit/4e09a1bc5ac03bd74204aeb0ccc4f08f56d870e3), but it's 
    # sized so small that it results in a high cache miss rate for large builds. This patch allows us to 
    # get back the old behavior (unlimited sized cache) without changing the waf source code. If the 
    # preproc_cache_node member variable name is changed, this patch will have to be updated accordingly.
    # The patch wraps the existing method with logic to ensure that the cache is always set to use a 
    # plain dict, so that an LRU cache will never be used.
    from waflib.Tools import c_preproc
    _old_cached_find_resource = c_preproc.c_parser.cached_find_resource
    def _cached_find_resource(self, node, filename):
        # Check if a cache is already available.
        cache_available = hasattr(node.ctx, 'preproc_cache_node')