Fix handling of pch_cpp_assume_unchanged
This commit is contained in:
parent
80e98ce2d3
commit
e2d16844a8
15
SConstruct
15
SConstruct
|
@ -1794,16 +1794,16 @@ class PCHManager(object):
|
|||
if syspch_object_node:
|
||||
env.Depends(ownpch_object_node, syspch_object_node)
|
||||
self.pch_CXXFLAGS = ['-include', ownpch_cpp_filename or syspch_cpp_filename, '-Winvalid-pch']
|
||||
# If assume unchanged and the file exists, skip registering the
|
||||
# emitter and set __files_included to a dummy value. This
|
||||
# bypasses scanning source files and guarantees that the text of
|
||||
# pch.cpp is not changed. SCons will still recompile pch.cpp
|
||||
# into a new .gch file if pch.cpp includes files that SCons
|
||||
# recognizes as changed.
|
||||
# If assume unchanged and the file exists, set __files_included
|
||||
# to a dummy value. This bypasses scanning source files and
|
||||
# guarantees that the text of pch.cpp is not changed. SCons
|
||||
# will still recompile pch.cpp into a new .gch file if pch.cpp
|
||||
# includes files that SCons recognizes as changed.
|
||||
if user_settings.pch_cpp_assume_unchanged and \
|
||||
(not syspch_cpp_filename or os.path.exists(syspch_cpp_filename)) and \
|
||||
(not ownpch_cpp_filename or os.path.exists(ownpch_cpp_filename)):
|
||||
return
|
||||
self.__files_included = True
|
||||
else:
|
||||
# collections.defaultdict with key from ScannedFile.candidates,
|
||||
# value is a collections.Counter with key=tuple of preprocessor
|
||||
# guards, value=count of times this header was included under
|
||||
|
@ -2137,6 +2137,7 @@ class PCHManager(object):
|
|||
# referenced by the command line or the source files, so SCons
|
||||
# may not recognize it as an input.
|
||||
env.Requires(o, self.required_pch_object_node)
|
||||
if self.__files_included is not True:
|
||||
self.record_file(env, source)
|
||||
return o
|
||||
|
||||
|
|
Loading…
Reference in a new issue