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