Sha256: 4a3dabf47a5fc9aa34d0b921188ba1eef638e5d02704f7f3e379fecd5b366891
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
import platform, sys; import subprocess import os # Lets get the version from git # first get the base version git_sha = subprocess.Popen(["git","rev-parse","--short=10","HEAD"], stdout=subprocess.PIPE ).communicate()[0].strip() p1 = subprocess.Popen(["git", "status"], stdout=subprocess.PIPE ) p2 = subprocess.Popen(["grep", "Changed but not updated\\|Changes to be committed"], stdin=p1.stdout,stdout=subprocess.PIPE) result = p2.communicate()[0].strip() if result!="": git_sha += "[MOD]" print "Building version %s"%git_sha env = Environment() env.Append( CPPPATH=['./include'] ) if sys.platform=="linux2" or sys.platform=="linux": env.Append( CXXFLAGS='-pthread') elif sys.platform=="sunos5": env.Append( CXXFLAGS='-pthreads') env['CXX']='/usr/sfw/bin/g++' env.Append( LIBS=['socket','resolv','nsl']) env.Append( CPPFLAGS=['-g','-Wall','-O2'] ) #A library containing several of the objects just to make linking the tests easier def version_action(target,source,env): """ Generate file with current version info """ fd=open(target[0].path,'w') fd.write( "static const char version_cstr[] = \"%s (\" __DATE__ \")\";\nconst char * version()\n{\n return version_cstr;\n}\n" % git_sha ) fd.close() return 0 build_version = env.Command( 'src/autogen_version.cpp', [], Action(version_action) ) env.AlwaysBuild(build_version) src = Glob('src/*.cpp') env.Library('fastjson', src)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simdjson-0.3.0 | vendor/simdjson/dependencies/fastjson/SConstruct |