diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-02-13 16:38:54 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-03-20 18:38:42 -0400 |
commit | e4c62ca157aeeed8343d5f2b9a60192d75406f9e (patch) | |
tree | 576cafbeed3faaf60549c4d465c526606cec5129 /site_scons | |
parent | d595a0fc8150411fd6541d06b08de9bee0039baa (diff) | |
download | mongo-e4c62ca157aeeed8343d5f2b9a60192d75406f9e.tar.gz |
SERVER-28324 Generate cpp files containing js strings outside of the scons process
This matches how the other python-generated source files work.
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/jsheader.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/site_scons/site_tools/jsheader.py b/site_scons/site_tools/jsheader.py index 284ed239d5a..cb418506200 100644 --- a/site_scons/site_tools/jsheader.py +++ b/site_scons/site_tools/jsheader.py @@ -1,15 +1,13 @@ -import os +from SCons.Script import Action -from jstoh import jsToHeader -from SCons.Builder import Builder - -def jsToH(target, source, env): - jsToHeader(str(target[0]), source) - -jshBuilder = Builder( action=jsToH ) +def jsToH(env, target, source): + return env.Command( + target=target, + source=['#site_scons/site_tools/jstoh.py'] + source, + action=Action('$PYTHON ${SOURCES[0]} $TARGET ${SOURCES[1:]}')) def generate(env, **kw): - env.Append( BUILDERS=dict( JSHeader=jshBuilder ) ) + env.AddMethod(jsToH, 'JSHeader') def exists(env): return True |