Details
Description
If you build mongo.vcxproj it will fail because it cannot find mongo.cpp and mongo-server.cpp.
I don't know python but I put what I believe to be the sconstruct snippet that makes these files at the end of this post. To not introduce python as a dependency on building mngo with visual studio I think a javascript or vbscript should be written and executed with cscript.exe to duplicate this functionality. That script can be called as part of a prebuild action.
Justin
- — jsh —
def jsToH(target, source, env):
outFile = str( target[0] )
if len( source ) != 1:
raise Exception( "wrong" )
h = "const char * jsconcatcode" + outFile.split( "mongo" )[-1].replace( "-" , "_").split( ".cpp")[0] + " = \n"
for l in open( str(source[0]) , 'r' ):
l = l.strip()
l = l.split( "//" )[0]
l = l.replace( '
' , "\\\\" )
l = l.replace( '"' , "\\\"" )
h += '"' + l + "\\n\"\n "
h += ";\n\n"
out = open( outFile , 'w' )
out.write( h )
return None
jshBuilder = Builder(action = jsToH,
suffix = '.cpp',
src_suffix = '.jsall')
env.Append( BUILDERS=
{'JSHeader' : jshBuilder})