summaryrefslogtreecommitdiffstats
blob: b15448a3fa6c6aca00c08d1984e16b5fdd267bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import SCons.Util

import Version

def generate(env) :
	def createBuildVersion(env, target, project) :
		buildVersion = """#pragma once

static const char* buildVersion = \"%(buildVersion)s\";\n
#define SWIFT_VERSION_STRING \"%(buildVersion)s\";\n
""" % { "buildVersion" : Version.getBuildVersion(env.Dir("#").abspath, project) }
		env.WriteVal(target, env.Value(buildVersion))

	env.AddMethod(createBuildVersion, "BuildVersion")


def exists(env) :
	return true