Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

enable precompiled headers with g++

The original author of gch.py didn't understand how str.strip worked
  • Loading branch information...
commit f5503895cf4f6b33b39fc7cd9681d6f7a94c9a07 1 parent b0b5a0c
@RedBeard0531 RedBeard0531 authored
Showing with 6 additions and 5 deletions.
  1. +1 −3 SConstruct
  2. +5 −2 gch.py
View
4 SConstruct
@@ -751,11 +751,9 @@ if nix:
env.Append( CPPDEFINES=["USE_GDBSERVER"] )
# pre-compiled headers
- if False and 'Gch' in dir( env ):
+ if 'Gch' in dir( env ):
print( "using precompiled headers" )
env['Gch'] = env.Gch( [ "pch.h" ] )[0]
- #Depends( "pch.o" , "pch.h.gch" )
- #SideEffect( "dummyGCHSideEffect" , "pch.h.gch" )
if usev8:
env.Append( CPPPATH=["../v8/include/"] )
View
7 gch.py
@@ -37,6 +37,9 @@
def gen_suffix(env, sources):
return sources[0].get_suffix() + env['GCHSUFFIX']
+def header_path(node):
+ path = node.path
+ return path[:-4] # strip final '.gch'
GchShBuilder = SCons.Builder.Builder(action = GchShAction,
source_scanner = SCons.Scanner.C.CScanner(),
@@ -54,7 +57,7 @@ def static_pch_emitter(target,source,env):
deps = scanner(source[0], env, path)
if env.has_key('Gch') and env['Gch']:
- if env['Gch'].path.strip('.gch') in [x.path for x in deps]:
+ if header_path(env['Gch']) in [x.path for x in deps]:
env.Depends(target, env['Gch'])
return (target, source)
@@ -67,7 +70,7 @@ def shared_pch_emitter(target,source,env):
deps = scanner(source[0], env, path)
if env.has_key('GchSh') and env['GchSh']:
- if env['GchSh'].path.strip('.gch') in [x.path for x in deps]:
+ if header_path(env['GchSh']) in [x.path for x in deps]:
env.Depends(target, env['GchSh'])
return (target, source)
Please sign in to comment.
Something went wrong with that request. Please try again.