mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-06 08:27:27 +02:00
change .format to support python 2.6
This commit is contained in:
20
SConscript
20
SConscript
@@ -106,7 +106,7 @@ if not tool and compilePlatform == "Linux" and compilePlatform != platform:
|
|||||||
else:
|
else:
|
||||||
crossList = ["x86_64-w64-mingw32", "i686-w64-mingw32", "amd64-mingw32msvc"]
|
crossList = ["x86_64-w64-mingw32", "i686-w64-mingw32", "amd64-mingw32msvc"]
|
||||||
for i in crossList:
|
for i in crossList:
|
||||||
if WhereIs("{}-g++".format(i)):
|
if WhereIs("{0}-g++".format(i)):
|
||||||
env['ENV']['PATH'] = "/usr/{0}/bin:{1}".format(i, os.environ['PATH'])
|
env['ENV']['PATH'] = "/usr/{0}/bin:{1}".format(i, os.environ['PATH'])
|
||||||
tool = i+"-"
|
tool = i+"-"
|
||||||
break
|
break
|
||||||
@@ -126,7 +126,7 @@ if tool:
|
|||||||
for var in ["CC","CXX","LD","LIBPATH"]:
|
for var in ["CC","CXX","LD","LIBPATH"]:
|
||||||
if var in os.environ:
|
if var in os.environ:
|
||||||
env[var] = os.environ[var]
|
env[var] = os.environ[var]
|
||||||
print "copying enviroment variable {}={!r}".format(var,os.environ[var])
|
print "copying enviroment variable {0}={1!r}".format(var,os.environ[var])
|
||||||
# variables containing several space separated things
|
# variables containing several space separated things
|
||||||
for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]:
|
for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]:
|
||||||
if var in os.environ:
|
if var in os.environ:
|
||||||
@@ -134,7 +134,7 @@ for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]:
|
|||||||
env[var] += SCons.Util.CLVar(os.environ[var])
|
env[var] += SCons.Util.CLVar(os.environ[var])
|
||||||
else:
|
else:
|
||||||
env[var] = SCons.Util.CLVar(os.environ[var])
|
env[var] = SCons.Util.CLVar(os.environ[var])
|
||||||
print "copying enviroment variable {}={!r}".format(var,os.environ[var])
|
print "copying enviroment variable {0}={1!r}".format(var,os.environ[var])
|
||||||
|
|
||||||
#Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given
|
#Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given
|
||||||
def add32bitflags(env):
|
def add32bitflags(env):
|
||||||
@@ -198,12 +198,12 @@ def CheckBit(context):
|
|||||||
def CheckFramework(context, framework):
|
def CheckFramework(context, framework):
|
||||||
import SCons.Conftest
|
import SCons.Conftest
|
||||||
#Extreme hack, TODO: maybe think of a better one (like replicating CheckLib here) or at least just fix the message
|
#Extreme hack, TODO: maybe think of a better one (like replicating CheckLib here) or at least just fix the message
|
||||||
ret = SCons.Conftest.CheckLib(context, ['m" -framework {}"'.format(framework)], autoadd = 0)
|
ret = SCons.Conftest.CheckLib(context, ['m" -framework {0}"'.format(framework)], autoadd = 0)
|
||||||
context.did_show_result = 1
|
context.did_show_result = 1
|
||||||
if not ret:
|
if not ret:
|
||||||
context.env.Append(LINKFLAGS=["-framework", framework])
|
context.env.Append(LINKFLAGS=["-framework", framework])
|
||||||
if framework != "Cocoa":
|
if framework != "Cocoa":
|
||||||
env.Append(CPPPATH=['/Library/Frameworks/{}.framework/Headers/'.format(framework)])
|
env.Append(CPPPATH=['/Library/Frameworks/{0}.framework/Headers/'.format(framework)])
|
||||||
return not ret
|
return not ret
|
||||||
|
|
||||||
#function that finds libraries and appends them to LIBS
|
#function that finds libraries and appends them to LIBS
|
||||||
@@ -457,18 +457,18 @@ elif GetOption("no-warnings"):
|
|||||||
|
|
||||||
#Add version defines
|
#Add version defines
|
||||||
if GetOption('save-version'):
|
if GetOption('save-version'):
|
||||||
env.Append(CPPDEFINES="SAVE_VERSION={}".format(GetOption('save-version')))
|
env.Append(CPPDEFINES="SAVE_VERSION={0}".format(GetOption('save-version')))
|
||||||
|
|
||||||
if GetOption('minor-version'):
|
if GetOption('minor-version'):
|
||||||
env.Append(CPPDEFINES="MINOR_VERSION={}".format(GetOption('minor-version')))
|
env.Append(CPPDEFINES="MINOR_VERSION={0}".format(GetOption('minor-version')))
|
||||||
|
|
||||||
if GetOption('build-number'):
|
if GetOption('build-number'):
|
||||||
env.Append(CPPDEFINES="BUILD_NUM={}".format(GetOption('build-number')))
|
env.Append(CPPDEFINES="BUILD_NUM={0}".format(GetOption('build-number')))
|
||||||
|
|
||||||
if GetOption('snapshot-id'):
|
if GetOption('snapshot-id'):
|
||||||
env.Append(CPPDEFINES=["SNAPSHOT", "SNAPSHOT_ID={}".format(GetOption('snapshot-id'))])
|
env.Append(CPPDEFINES=["SNAPSHOT", "SNAPSHOT_ID={0}".format(GetOption('snapshot-id'))])
|
||||||
elif GetOption('snapshot'):
|
elif GetOption('snapshot'):
|
||||||
env.Append(CPPDEFINES=["SNAPSHOT", "SNAPSHOT_ID={}".format(str(int(time.time())))])
|
env.Append(CPPDEFINES=["SNAPSHOT", "SNAPSHOT_ID={0}".format(str(int(time.time())))])
|
||||||
|
|
||||||
if GetOption('beta'):
|
if GetOption('beta'):
|
||||||
env.Append(CPPDEFINES="BETA")
|
env.Append(CPPDEFINES="BETA")
|
||||||
|
Reference in New Issue
Block a user