Skip to content

Commit

Permalink
Update SConscript
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Aug 30, 2016
1 parent 3cf0feb commit 07e97ed
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/cpp/SConscript
Expand Up @@ -16,46 +16,6 @@ cppenv = env.Clone()

headers = cppenv.Glob('*.h*')
includes = cppenv.Install(os.path.join(cppenv['PREFIX'], "include", "clanglite"), headers)

GchShAction = SCons.Action.Action('$GCHSHCOM', '$GCHSHCOMSTR')

def gen_suffix(env, sources):
return sources[0].get_suffix() + env['GCHSUFFIX']

GchShBuilder = SCons.Builder.Builder(action = GchShAction,
source_scanner = SCons.Scanner.C.CScanner(),
suffix = gen_suffix)

def shared_pch_emitter(target,source,env):
SCons.Defaults.SharedObjectEmitter( target, source, env )

scanner = SCons.Scanner.C.CScanner()
path = scanner.path(env)
deps = scanner(source[0], env, path)

if env.get('GchSh'):
if env['GchSh'].path.strip('.gch') in [x.path for x in deps]:
env.Depends(target, env['GchSh'])
return (target, source)

env.Append(BUILDERS = {
'gchsh': env.Builder(
action = GchShAction,
target_factory = env.fs.File,
),
})

bldsh = GchShBuilder
env['BUILDERS']['GchSh'] = bldsh

env['GCHSHCOM'] = '$CXX -o $TARGET -x c++-header -c $SHCXXFLAGS $_CCCOMCOM $SOURCE'
env['GCHSUFFIX'] = '.gch'

for suffix in SCons.Util.Split('.c .C .cc .cxx .cpp .c++'):
env['BUILDERS']['SharedObject'].add_emitter(suffix, shared_pch_emitter)

env['GchSh'] = env.GchSh(includes)[0]

Alias("cpp", includes)
Alias("build", includes)

Expand Down

0 comments on commit 07e97ed

Please sign in to comment.