mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Support python3 in SCons
This commit is contained in:
@@ -78,16 +78,16 @@ CMAKE_UNITY_COMBOS = { '' : [['rippled', 'rippled_classic'], CMAKE_UNITY_CONFIGS
|
||||
|
||||
if IS_WINDOWS:
|
||||
CMAKE_DIR_TARGETS = { ('msvc' + unity,) : targets for unity, targets in
|
||||
CMAKE_UNITY_COMBOS.iteritems() }
|
||||
CMAKE_UNITY_COMBOS.items() }
|
||||
elif IS_OS_X:
|
||||
CMAKE_DIR_TARGETS = { (build + unity,) : targets
|
||||
for build in ['debug', 'release']
|
||||
for unity, targets in CMAKE_UNITY_COMBOS.iteritems() }
|
||||
for unity, targets in CMAKE_UNITY_COMBOS.items() }
|
||||
else:
|
||||
CMAKE_DIR_TARGETS = { (cc + "." + build + unity,) : targets
|
||||
for cc in ['gcc', 'clang']
|
||||
for build in ['debug', 'release', 'coverage', 'profile']
|
||||
for unity, targets in CMAKE_UNITY_COMBOS.iteritems() }
|
||||
for unity, targets in CMAKE_UNITY_COMBOS.items() }
|
||||
|
||||
# list of tuples of all possible options
|
||||
if IS_WINDOWS or IS_OS_X:
|
||||
@@ -450,7 +450,7 @@ def main():
|
||||
ARGS.build_option = list(ARGS.extra_args)
|
||||
|
||||
for args in generator_options:
|
||||
for build_dirs, (build_targets, build_configs) in build_dir_targets.iteritems():
|
||||
for build_dirs, (build_targets, build_configs) in build_dir_targets.items():
|
||||
if not build_dirs:
|
||||
build_dirs = ('default',)
|
||||
if not build_targets:
|
||||
|
||||
@@ -422,7 +422,7 @@ def get_libs(lib, static):
|
||||
try:
|
||||
cmd = ['pkg-config', '--static', '--libs', lib]
|
||||
libs = subprocess.check_output(cmd,
|
||||
stderr=subprocess.STDOUT).strip()
|
||||
stderr=subprocess.STDOUT).strip().decode("utf-8")
|
||||
all_libs = [l[2:] for l in libs.split() if l.startswith('-l')]
|
||||
if not static:
|
||||
return ([], all_libs)
|
||||
@@ -1162,7 +1162,7 @@ for tu_style in ['classic', 'unity']:
|
||||
os.path.join(variant_dir, 'proto') :
|
||||
os.path.join (build_dir, 'proto'),
|
||||
}
|
||||
for dest, source in variant_dirs.iteritems():
|
||||
for dest, source in variant_dirs.items():
|
||||
env.VariantDir(dest, source, duplicate=0)
|
||||
|
||||
object_builder = ObjectBuilder(env, variant_dirs)
|
||||
@@ -1265,7 +1265,7 @@ for tu_style in ['classic', 'unity']:
|
||||
[object_builder.env] + object_builder.child_envs + [base],
|
||||
dest_file='build.ninja')
|
||||
|
||||
for key, value in aliases.iteritems():
|
||||
for key, value in aliases.items():
|
||||
env.Alias(key, value)
|
||||
|
||||
vcxproj = base.VSProject(
|
||||
@@ -1306,6 +1306,6 @@ def do_count(target, source, env):
|
||||
lines = 0
|
||||
for f in testfiles:
|
||||
lines = lines + sum(1 for line in open(f))
|
||||
print "Total unit test lines: %d" % lines
|
||||
print ("Total unit test lines: %d" % lines)
|
||||
|
||||
PhonyTargets(env, count = do_count)
|
||||
|
||||
@@ -111,7 +111,7 @@ def printChildren(target):
|
||||
def variantFile(path, variant_dirs):
|
||||
'''Returns the path to the corresponding dict entry in variant_dirs'''
|
||||
path = str(path)
|
||||
for dest, source in variant_dirs.iteritems():
|
||||
for dest, source in variant_dirs.items():
|
||||
common = os.path.commonprefix([path, source])
|
||||
if common == source:
|
||||
return os.path.join(dest, path[len(common)+1:])
|
||||
|
||||
@@ -816,12 +816,12 @@ class _ProjectGenerator(object):
|
||||
def build(self):
|
||||
try:
|
||||
self.project_file = open(str(self.project_node), 'wb')
|
||||
except IOError, detail:
|
||||
except (IOError, detail):
|
||||
raise SCons.Errors.InternalError('Unable to open "' +
|
||||
str(self.project_node) + '" for writing:' + str(detail))
|
||||
try:
|
||||
self.filters_file = open(str(self.filters_node), 'wb')
|
||||
except IOError, detail:
|
||||
except (IOError, detail):
|
||||
raise SCons.Errors.InternalError('Unable to open "' +
|
||||
str(self.filters_node) + '" for writing:' + str(detail))
|
||||
self.writeProject()
|
||||
|
||||
Reference in New Issue
Block a user