mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 12:42:11 +00:00
Fix syntax errors in rc.py and midl.py.
This commit is contained in:
committed by
U-Sivonja\Juraj
parent
0a13310cdc
commit
6950d8373e
@@ -11,7 +11,7 @@ from b2.build.toolset import flags
|
||||
from b2.build.feature import feature
|
||||
from b2.manager import get_manager
|
||||
from b2.tools import builtin, common
|
||||
from b2.util import regex
|
||||
from b2.util import regex, utility
|
||||
|
||||
def init():
|
||||
pass
|
||||
@@ -52,8 +52,8 @@ class MidlScanner(scanner.Scanner):
|
||||
imported_tlbs = regex.transform(matches, self.re_importlib, [1, 3])
|
||||
|
||||
# CONSIDER: the new scoping rule seem to defeat "on target" variables.
|
||||
g = bjam.call('get-target-variable', target, 'HDRGRIST')
|
||||
b = os.path.normalize_path(os.path.dirname(binding))
|
||||
g = bjam.call('get-target-variable', target, 'HDRGRIST')[0]
|
||||
b = os.path.normpath(os.path.dirname(binding))
|
||||
|
||||
# Attach binding of including file to included targets.
|
||||
# When target is directly created from virtual target
|
||||
@@ -75,10 +75,10 @@ class MidlScanner(scanner.Scanner):
|
||||
bjam.call('INCLUDES', [target], all)
|
||||
bjam.call('DEPENDS', [target], imported_tlbs)
|
||||
bjam.call('NOCARE', all + imported_tlbs)
|
||||
engine.set_target_variable(included_angle , 'SEARCH', ungrist(self.includes))
|
||||
engine.set_target_variable(included_quoted, 'SEARCH', b + ungrist(self.includes))
|
||||
engine.set_target_variable(imported , 'SEARCH', b + ungrist(self.includes))
|
||||
engine.set_target_variable(imported_tlbs , 'SEARCH', b + ungrist(self.includes))
|
||||
engine.set_target_variable(included_angle , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
|
||||
engine.set_target_variable(included_quoted, 'SEARCH', [utility.get_value(inc) for inc in self.includes])
|
||||
engine.set_target_variable(imported , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
|
||||
engine.set_target_variable(imported_tlbs , 'SEARCH', [utility.get_value(inc) for inc in self.includes])
|
||||
|
||||
get_manager().scanners().propagate(type.get_scanner('CPP', PropertySet(self.includes)), included_angle + included_quoted)
|
||||
get_manager().scanners().propagate(self, imported)
|
||||
|
||||
@@ -21,11 +21,17 @@
|
||||
##import scanner ;
|
||||
##import toolset : flags ;
|
||||
|
||||
import os.path
|
||||
import re
|
||||
|
||||
import bjam
|
||||
|
||||
from b2.build import type, toolset, generators, scanner, feature
|
||||
from b2.tools import builtin
|
||||
from b2.util import regex
|
||||
from b2.build.toolset import flags
|
||||
from b2.manager import get_manager
|
||||
from b2.util import utility
|
||||
|
||||
__debug = None
|
||||
|
||||
@@ -135,7 +141,7 @@ class ResScanner(scanner.Scanner):
|
||||
"[ ]+([^ \"]+|\"[^\"]+\"))|(#include[ ]*(<[^<]+>|\"[^\"]+\")))" ;
|
||||
|
||||
def process(self, target, matches, binding):
|
||||
|
||||
binding = binding[0]
|
||||
angle = regex.transform(matches, "#include[ ]*<([^<]+)>")
|
||||
quoted = regex.transform(matches, "#include[ ]*\"([^\"]+)\"")
|
||||
res = regex.transform(matches,
|
||||
@@ -147,11 +153,11 @@ class ResScanner(scanner.Scanner):
|
||||
# IDR_MAINFRAME ICON "res\\icon.ico"
|
||||
#
|
||||
# so we have to replace double backslashes to single ones.
|
||||
res = [ re.sub(r'\\\\', '/', match) for match in res ]
|
||||
res = [ re.sub(r'\\\\', '/', match) for match in res if match is not None ]
|
||||
|
||||
# CONSIDER: the new scoping rule seem to defeat "on target" variables.
|
||||
g = bjam.call('get-target-variable', target, 'HDRGRIST')
|
||||
b = os.path.normalize_path(os.path.dirname(binding))
|
||||
g = bjam.call('get-target-variable', target, 'HDRGRIST')[0]
|
||||
b = os.path.normpath(os.path.dirname(binding))
|
||||
|
||||
# Attach binding of including file to included targets.
|
||||
# When target is directly created from virtual target
|
||||
@@ -177,9 +183,9 @@ class ResScanner(scanner.Scanner):
|
||||
|
||||
engine.add_dependency(target, res)
|
||||
bjam.call('NOCARE', all + res)
|
||||
engine.set_target_variable(angle, 'SEARCH', ungrist(self.includes))
|
||||
engine.set_target_variable(quoted, 'SEARCH', b + ungrist(self.includes))
|
||||
engine.set_target_variable(res, 'SEARCH', b + ungrist(self.includes)) ;
|
||||
engine.set_target_variable(angle, 'SEARCH', [utility.get_value(inc) for inc in self.includes])
|
||||
engine.set_target_variable(quoted, 'SEARCH', [b + utility.get_value(inc) for inc in self.includes])
|
||||
engine.set_target_variable(res, 'SEARCH', [b + utility.get_value(inc) for inc in self.includes])
|
||||
|
||||
# Just propagate current scanner to includes, in a hope
|
||||
# that includes do not change scanners.
|
||||
|
||||
Reference in New Issue
Block a user