Simplify PCH filename passing
This commit is contained in:
parent
522c37b898
commit
5df6dc47fb
|
@ -2175,6 +2175,8 @@ class PCHManager(object):
|
||||||
# List of currently active preprocessor guards
|
# List of currently active preprocessor guards
|
||||||
guard = []
|
guard = []
|
||||||
header_search_path = None
|
header_search_path = None
|
||||||
|
os_path_join = os.path.join
|
||||||
|
os_path_exists = os.path.exists
|
||||||
for line in map(str.strip, source_filenode.get_contents().splitlines()):
|
for line in map(str.strip, source_filenode.get_contents().splitlines()):
|
||||||
if preceding_line is not None:
|
if preceding_line is not None:
|
||||||
# Basic support for line continuation.
|
# Basic support for line continuation.
|
||||||
|
@ -2225,8 +2227,8 @@ class PCHManager(object):
|
||||||
]
|
]
|
||||||
name = None
|
name = None
|
||||||
for d in header_search_path:
|
for d in header_search_path:
|
||||||
effective_name = os.path.join(d, bare_name)
|
effective_name = os_path_join(d, bare_name)
|
||||||
if os.path.exists(effective_name):
|
if os_path_exists(effective_name):
|
||||||
name = effective_name
|
name = effective_name
|
||||||
break
|
break
|
||||||
if name is None:
|
if name is None:
|
||||||
|
@ -2241,7 +2243,6 @@ class PCHManager(object):
|
||||||
# will evaluate as false.
|
# will evaluate as false.
|
||||||
continue
|
continue
|
||||||
name = env.File(name)
|
name = env.File(name)
|
||||||
name.__filename = '"%s"' % effective_name
|
|
||||||
candidates[name].add(tuple(guard))
|
candidates[name].add(tuple(guard))
|
||||||
elif directive == 'endif':
|
elif directive == 'endif':
|
||||||
# guard should always be True here, but test to avoid
|
# guard should always be True here, but test to avoid
|
||||||
|
@ -2283,7 +2284,7 @@ class PCHManager(object):
|
||||||
else:
|
else:
|
||||||
# Own header
|
# Own header
|
||||||
cpp_includes = owncpp_includes
|
cpp_includes = owncpp_includes
|
||||||
name = included_file.__filename
|
name = '"%s"' % included_file
|
||||||
threshold = own_header_inclusion_threshold
|
threshold = own_header_inclusion_threshold
|
||||||
if not threshold:
|
if not threshold:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue