Fix PCH conditional nesting
This commit is contained in:
parent
bba8a327a0
commit
6be3c0e13a
30
SConstruct
30
SConstruct
|
@ -3015,13 +3015,14 @@ class PCHManager(object):
|
||||||
# Ignore generated header here. PCH generation
|
# Ignore generated header here. PCH generation
|
||||||
# will insert it in the right order.
|
# will insert it in the right order.
|
||||||
continue
|
continue
|
||||||
if name == b'"valptridx.tcc"':
|
if not name.endswith(b'.h"'):
|
||||||
# Exclude tcc file from PCH. It is not meant to
|
# Exclude non-header files from PCH.
|
||||||
# be included in every file. Starting in gcc-7,
|
#
|
||||||
# static functions defined in valptridx.tcc
|
# Starting in gcc-7, static functions defined in
|
||||||
# generate -Wunused-function warnings if the
|
# valptridx.tcc generate -Wunused-function
|
||||||
# including file does not instantiate any
|
# warnings if the including file does not
|
||||||
# templates that use the static function.
|
# instantiate any templates that use the static
|
||||||
|
# function.
|
||||||
continue
|
continue
|
||||||
if header_search_path is None:
|
if header_search_path is None:
|
||||||
header_search_path = [
|
header_search_path = [
|
||||||
|
@ -3049,10 +3050,17 @@ class PCHManager(object):
|
||||||
name = env.File(name.decode())
|
name = env.File(name.decode())
|
||||||
candidates[name].add(tuple(guard))
|
candidates[name].add(tuple(guard))
|
||||||
elif directive == b'endif':
|
elif directive == b'endif':
|
||||||
# guard should always be True here, but test to avoid
|
while guard:
|
||||||
# ugly errors if scanning an ill-formed source file.
|
g = guard.pop()
|
||||||
if guard:
|
if g == b'#else':
|
||||||
guard.pop()
|
# guard should always be True here, but test to
|
||||||
|
# avoid ugly errors if scanning an ill-formed
|
||||||
|
# source file.
|
||||||
|
if guard:
|
||||||
|
guard.pop()
|
||||||
|
break
|
||||||
|
if not g.startswith(b'#elif '):
|
||||||
|
break
|
||||||
elif directive == b'else':
|
elif directive == b'else':
|
||||||
# #else is handled separately because it has no
|
# #else is handled separately because it has no
|
||||||
# arguments
|
# arguments
|
||||||
|
|
Loading…
Reference in a new issue