2016-10-17 06:50:25 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
Import('env')
|
|
|
|
|
2014-02-16 00:16:33 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
def make_doc_header(target, source, env):
|
2014-02-16 00:16:33 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
src = source[0].srcnode().abspath
|
|
|
|
dst = target[0].srcnode().abspath
|
2016-10-30 17:57:40 +00:00
|
|
|
f = open(src, "rb")
|
|
|
|
g = open(dst, "wb")
|
2016-10-30 17:44:57 +00:00
|
|
|
buf = f.read()
|
|
|
|
decomp_size = len(buf)
|
|
|
|
import zlib
|
|
|
|
buf = zlib.compress(buf)
|
2014-02-16 00:16:33 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
|
|
|
g.write("#ifndef _DOC_DATA_RAW_H\n")
|
|
|
|
g.write("#define _DOC_DATA_RAW_H\n")
|
2016-10-30 17:57:40 +00:00
|
|
|
g.write("static const int _doc_data_compressed_size=" + str(len(buf)) + ";\n")
|
|
|
|
g.write("static const int _doc_data_uncompressed_size=" + str(decomp_size) + ";\n")
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("static const unsigned char _doc_data_compressed[]={\n")
|
|
|
|
for i in range(len(buf)):
|
2016-10-30 17:57:40 +00:00
|
|
|
g.write(str(ord(buf[i])) + ",\n")
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("};\n")
|
|
|
|
g.write("#endif")
|
2014-02-16 00:16:33 +00:00
|
|
|
|
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
def make_certs_header(target, source, env):
|
2016-03-12 13:44:12 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
src = source[0].srcnode().abspath
|
|
|
|
dst = target[0].srcnode().abspath
|
2016-10-30 17:57:40 +00:00
|
|
|
f = open(src, "rb")
|
|
|
|
g = open(dst, "wb")
|
2016-10-30 17:44:57 +00:00
|
|
|
buf = f.read()
|
|
|
|
decomp_size = len(buf)
|
|
|
|
import zlib
|
|
|
|
buf = zlib.compress(buf)
|
2016-03-12 13:44:12 +00:00
|
|
|
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
|
|
|
g.write("#ifndef _CERTS_RAW_H\n")
|
|
|
|
g.write("#define _CERTS_RAW_H\n")
|
2016-10-30 17:57:40 +00:00
|
|
|
g.write("static const int _certs_compressed_size=" + str(len(buf)) + ";\n")
|
|
|
|
g.write("static const int _certs_uncompressed_size=" + str(decomp_size) + ";\n")
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("static const unsigned char _certs_compressed[]={\n")
|
|
|
|
for i in range(len(buf)):
|
2016-10-30 17:57:40 +00:00
|
|
|
g.write(str(ord(buf[i])) + ",\n")
|
2016-10-30 17:44:57 +00:00
|
|
|
g.write("};\n")
|
|
|
|
g.write("#endif")
|
2016-03-12 13:44:12 +00:00
|
|
|
|
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
if (env["tools"] == "yes"):
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
reg_exporters_inc = '#include "register_exporters.h"\n'
|
|
|
|
reg_exporters = 'void register_exporters() {\n'
|
2016-10-30 17:44:57 +00:00
|
|
|
for e in env.platform_exporters:
|
2016-10-30 17:57:40 +00:00
|
|
|
env.tool_sources.append("#platform/" + e + "/export/export.cpp")
|
|
|
|
reg_exporters += '\tregister_' + e + '_exporter();\n'
|
|
|
|
reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n'
|
|
|
|
reg_exporters += '}\n'
|
|
|
|
f = open("register_exporters.cpp", "wb")
|
2016-10-30 17:44:57 +00:00
|
|
|
f.write(reg_exporters_inc)
|
|
|
|
f.write(reg_exporters)
|
|
|
|
f.close()
|
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
env.Depends("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml")
|
|
|
|
env.Command("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml", make_doc_header)
|
2016-10-30 17:44:57 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
env.Depends("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt")
|
|
|
|
env.Command("#tools/editor/certs_compressed.h", "#tools/certs/ca-certificates.crt", make_certs_header)
|
2016-10-30 17:44:57 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
# make_doc_header(env.File("#tools/editor/doc_data_raw.h").srcnode().abspath,env.File("#doc/base/classes.xml").srcnode().abspath,env)
|
2016-10-30 17:44:57 +00:00
|
|
|
|
2016-10-30 17:57:40 +00:00
|
|
|
env.add_source_files(env.tool_sources, "*.cpp")
|
2016-10-30 17:44:57 +00:00
|
|
|
|
|
|
|
Export('env')
|
|
|
|
SConscript('icons/SCsub');
|
|
|
|
SConscript('plugins/SCsub');
|
|
|
|
SConscript('fileserver/SCsub');
|
|
|
|
SConscript('io_plugins/SCsub');
|