Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (34 sloc) 1.236 kb
d67ce1c SCons refactoring, cleans up building and testing the C++ client.
Andy Schwerin authored
1 # -*- mode: python; -*-
2
3 # This SConscript describes construction of buildinfo.cpp, which is independent of the
4 # build variant's target.
5
6 import os
7 import sys
8
9 import buildscripts.utils
10
11 Import('env windows')
12
13 def getSysInfo():
14 if windows:
15 return "windows " + str( sys.getwindowsversion() )
16 else:
17 return " ".join( os.uname() )
18
19 buildinfo_filename = '#build/buildinfo.cpp'
20
21 buildinfo_template = '''
22 #include <string>
23 #include <boost/version.hpp>
24
25 #include "mongo/util/version.h"
26
27 namespace mongo {
28 const char * gitVersion() { return "%(git_version)s"; }
29 std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }
30 } // namespace mongo
31 '''
32
33 def generate_buildinfo(env, target, source, **kw):
34 contents = str(source[0]) % dict(git_version=buildscripts.utils.getGitVersion(),
35 sys_info=getSysInfo())
36 out = open(str(target[0]), 'wb')
37 try:
38 out.write(contents)
39 finally:
40 out.close()
41
42 env.Command(buildinfo_filename, Value(buildinfo_template), generate_buildinfo)
43 env.AlwaysBuild(buildinfo_filename)
44 env.Install('$BUILD_DIR/mongo', buildinfo_filename)
45 env.Install('$BUILD_DIR/client_build/mongo', buildinfo_filename)
Something went wrong with that request. Please try again.