BuildSystem: generated files have .gen.extension

This commit is contained in:
Poommetee Ketson 2017-06-23 22:03:41 +07:00
parent a2e4b80ff5
commit e3998528e0
35 changed files with 93 additions and 90 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
# Godot auto generated files
*.gen.*
core/global_defaults.cpp
core/method_bind_ext.inc
core/method_bind.inc

View file

@ -377,7 +377,7 @@ if selected_platform in platform_list:
methods.no_verbose(sys, env)
if (True): # FIXME: detect GLES3
env.Append( BUILDERS = { 'GLES3_GLSL' : env.Builder(action = methods.build_gles3_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.Append( BUILDERS = { 'GLES3_GLSL' : env.Builder(action = methods.build_gles3_headers, suffix = 'glsl.gen.h',src_suffix = '.glsl') } )
Export('env')

View file

@ -18,7 +18,7 @@ gd_cpp = '#include "global_config.h"\n'
gd_cpp += gd_inc
gd_cpp += "void GlobalConfig::register_global_defaults() {\n" + gd_call + "\n}\n"
f = open("global_defaults.cpp", "wb")
f = open("global_defaults.gen.cpp", "wb")
f.write(gd_cpp)
f.close()
@ -47,7 +47,7 @@ if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
print("Invalid AES256 encryption key, not 64 bits hex: " + e)
f = open("script_encryption_key.cpp", "wb")
f = open("script_encryption_key.gen.cpp", "wb")
f.write("#include \"global_config.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
f.close()
@ -109,7 +109,7 @@ env.add_source_files(env.core_sources, "*.cpp")
# Make binders
import make_binders
env.Command(['method_bind.inc', 'method_bind_ext.inc'], 'make_binders.py', make_binders.run)
env.Command(['method_bind.gen.inc', 'method_bind_ext.gen.inc'], 'make_binders.py', make_binders.run)
# Chain load SCsubs

View file

@ -343,6 +343,6 @@ MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, i
// if you declare an nonexistent class..
class __UnexistingClass;
#include "method_bind.inc"
#include "method_bind.gen.inc"
#endif

View file

@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "version_generated.h"
#include "version_generated.gen.h"
#ifdef VERSION_PATCH
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." _MKSTR(VERSION_STATUS) "." _MKSTR(VERSION_REVISION)

View file

@ -1,3 +1,5 @@
#!/usr/bin/env python
Import('env')
env.add_source_files(env.drivers_sources,"*.cpp")

View file

@ -32,7 +32,7 @@
#include "rasterizer_storage_gles3.h"
#include "servers/visual/rasterizer.h"
#include "shaders/canvas_shadow.glsl.h"
#include "shaders/canvas_shadow.glsl.gen.h"
class RasterizerCanvasGLES3 : public RasterizerCanvas {
public:

View file

@ -33,17 +33,17 @@
/* Must come before shaders or the Windows build fails... */
#include "rasterizer_storage_gles3.h"
#include "drivers/gles3/shaders/cube_to_dp.glsl.h"
#include "drivers/gles3/shaders/effect_blur.glsl.h"
#include "drivers/gles3/shaders/exposure.glsl.h"
#include "drivers/gles3/shaders/resolve.glsl.h"
#include "drivers/gles3/shaders/scene.glsl.h"
#include "drivers/gles3/shaders/screen_space_reflection.glsl.h"
#include "drivers/gles3/shaders/ssao.glsl.h"
#include "drivers/gles3/shaders/ssao_blur.glsl.h"
#include "drivers/gles3/shaders/ssao_minify.glsl.h"
#include "drivers/gles3/shaders/subsurf_scattering.glsl.h"
#include "drivers/gles3/shaders/tonemap.glsl.h"
#include "drivers/gles3/shaders/cube_to_dp.glsl.gen.h"
#include "drivers/gles3/shaders/effect_blur.glsl.gen.h"
#include "drivers/gles3/shaders/exposure.glsl.gen.h"
#include "drivers/gles3/shaders/resolve.glsl.gen.h"
#include "drivers/gles3/shaders/scene.glsl.gen.h"
#include "drivers/gles3/shaders/screen_space_reflection.glsl.gen.h"
#include "drivers/gles3/shaders/ssao.glsl.gen.h"
#include "drivers/gles3/shaders/ssao_blur.glsl.gen.h"
#include "drivers/gles3/shaders/ssao_minify.glsl.gen.h"
#include "drivers/gles3/shaders/subsurf_scattering.glsl.gen.h"
#include "drivers/gles3/shaders/tonemap.glsl.gen.h"
class RasterizerSceneGLES3 : public RasterizerScene {
public:

View file

@ -35,11 +35,11 @@
#include "servers/visual/shader_language.h"
#include "shader_compiler_gles3.h"
#include "shader_gles3.h"
#include "shaders/blend_shape.glsl.h"
#include "shaders/canvas.glsl.h"
#include "shaders/copy.glsl.h"
#include "shaders/cubemap_filter.glsl.h"
#include "shaders/particles.glsl.h"
#include "shaders/blend_shape.glsl.gen.h"
#include "shaders/canvas.glsl.gen.h"
#include "shaders/copy.glsl.gen.h"
#include "shaders/cubemap_filter.glsl.gen.h"
#include "shaders/particles.glsl.gen.h"
class RasterizerCanvasGLES3;
class RasterizerSceneGLES3;

View file

@ -1,22 +1,22 @@
#!/usr/bin/env python
Import('env')
if env['BUILDERS'].has_key('GLES3_GLSL'):
env.GLES3_GLSL('copy.glsl');
env.GLES3_GLSL('resolve.glsl');
env.GLES3_GLSL('canvas.glsl');
env.GLES3_GLSL('canvas_shadow.glsl');
env.GLES3_GLSL('scene.glsl');
env.GLES3_GLSL('cubemap_filter.glsl');
env.GLES3_GLSL('cube_to_dp.glsl');
env.GLES3_GLSL('blend_shape.glsl');
env.GLES3_GLSL('screen_space_reflection.glsl');
env.GLES3_GLSL('effect_blur.glsl');
env.GLES3_GLSL('subsurf_scattering.glsl');
env.GLES3_GLSL('ssao.glsl');
env.GLES3_GLSL('ssao_minify.glsl');
env.GLES3_GLSL('ssao_blur.glsl');
env.GLES3_GLSL('exposure.glsl');
env.GLES3_GLSL('tonemap.glsl');
env.GLES3_GLSL('particles.glsl');
env.GLES3_GLSL('copy.glsl');
env.GLES3_GLSL('resolve.glsl');
env.GLES3_GLSL('canvas.glsl');
env.GLES3_GLSL('canvas_shadow.glsl');
env.GLES3_GLSL('scene.glsl');
env.GLES3_GLSL('cubemap_filter.glsl');
env.GLES3_GLSL('cube_to_dp.glsl');
env.GLES3_GLSL('blend_shape.glsl');
env.GLES3_GLSL('screen_space_reflection.glsl');
env.GLES3_GLSL('effect_blur.glsl');
env.GLES3_GLSL('subsurf_scattering.glsl');
env.GLES3_GLSL('ssao.glsl');
env.GLES3_GLSL('ssao_minify.glsl');
env.GLES3_GLSL('ssao_blur.glsl');
env.GLES3_GLSL('exposure.glsl');
env.GLES3_GLSL('tonemap.glsl');
env.GLES3_GLSL('particles.glsl');

View file

@ -8,7 +8,7 @@ g_set_p += 'String OS_Unix::get_global_settings_path() const {\n'
g_set_p += '\treturn "' + env["unix_global_settings_path"] + '";\n'
g_set_p += '}\n'
g_set_p += '#endif'
f = open("os_unix_global_settings_path.cpp", "wb")
f = open("os_unix_global_settings_path.gen.cpp", "wb")
f.write(g_set_p)
f.close()

View file

@ -176,7 +176,7 @@ if (env["tools"] == "yes"):
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")
f = open("register_exporters.gen.cpp", "wb")
f.write(reg_exporters_inc)
f.write(reg_exporters)
f.close()
@ -189,12 +189,12 @@ if (env["tools"] == "yes"):
docfile = os.path.join(curmodle, "classes.xml")
if os.path.isdir(curmodle) and os.path.isfile(docfile):
docs.append(docfile)
env.Depends("#editor/doc_data_compressed.h", docs)
env.Command("#editor/doc_data_compressed.h", docs, make_doc_header)
env.Depends("#editor/doc_data_compressed.gen.h", docs)
env.Command("#editor/doc_data_compressed.gen.h", docs, make_doc_header)
# Certificates
env.Depends("#editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt")
env.Command("#editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header)
env.Depends("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt")
env.Command("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header)
import glob
path = env.Dir('.').abspath
@ -202,19 +202,19 @@ if (env["tools"] == "yes"):
# Translations
tlist = glob.glob(path + "/translations/*.po")
print("translations: ", tlist)
env.Depends('#editor/translations.h', tlist)
env.Command('#editor/translations.h', tlist, make_translations_header)
env.Depends('#editor/translations.gen.h', tlist)
env.Command('#editor/translations.gen.h', tlist, make_translations_header)
# Fonts
flist = glob.glob(path + "/../thirdparty/fonts/*.ttf")
flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf"))
print("fonts: ", flist)
env.Depends('#editor/builtin_fonts.h', flist)
env.Command('#editor/builtin_fonts.h', flist, make_fonts_header)
env.Depends('#editor/builtin_fonts.gen.h', flist)
env.Command('#editor/builtin_fonts.gen.h', flist, make_fonts_header)
# Authors
env.Depends('#editor/authors.h', "../AUTHORS.md")
env.Command('#editor/authors.h', "../AUTHORS.md", make_authors_header)
env.Depends('#editor/authors.gen.h', "../AUTHORS.md")
env.Command('#editor/authors.gen.h', "../AUTHORS.md", make_authors_header)
env.add_source_files(env.editor_sources, "*.cpp")

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "editor_fonts.h"
#include "builtin_fonts.h"
#include "builtin_fonts.gen.h"
#include "doc_code_font.h"
#include "doc_font.h"
#include "doc_title_font.h"

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "editor_help.h"
#include "doc_data_compressed.h"
#include "doc_data_compressed.gen.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
#include "editor_settings.h"

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "editor_initialize_ssl.h"
#include "certs_compressed.h"
#include "certs_compressed.gen.h"
#include "io/compression.h"
#include "io/stream_peer_ssl.h"

View file

@ -30,7 +30,7 @@
#include "editor_node.h"
#include "animation_editor.h"
#include "authors.h"
#include "authors.gen.h"
#include "bind/core_bind.h"
#include "class_db.h"
#include "core/io/resource_loader.h"

View file

@ -44,7 +44,7 @@
#include "scene/main/node.h"
#include "scene/main/scene_main_loop.h"
#include "scene/main/viewport.h"
#include "translations.h"
#include "translations.gen.h"
#include "version.h"
Ref<EditorSettings> EditorSettings::singleton = NULL;

View file

@ -90,7 +90,7 @@ make_editor_icons_builder = Builder(action=make_editor_icons_action,
suffix='.cpp',
src_suffix='.png')
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.cpp', Glob("*.png"))])
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.cpp', Glob("*.png"))])
env.editor_sources.append("#editor/editor_icons.cpp")
env.editor_sources.append("#editor/editor_icons.gen.cpp")
Export('env')

View file

@ -47,11 +47,11 @@ env.add_source_files(env.main_sources, "*.cpp")
Export('env')
env.Depends("#main/splash.h", "#main/splash.png")
env.Command("#main/splash.h", "#main/splash.png", make_splash)
env.Depends("#main/splash.gen.h", "#main/splash.png")
env.Command("#main/splash.gen.h", "#main/splash.png", make_splash)
env.Depends("#main/app_icon.h", "#main/app_icon.png")
env.Command("#main/app_icon.h", "#main/app_icon.png", make_app_icon)
env.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
env.Command("#main/app_icon.gen.h", "#main/app_icon.png", make_app_icon)
SConscript('tests/SCsub')

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "main.h"
#include "app_icon.h"
#include "app_icon.gen.h"
#include "core/register_core_types.h"
#include "drivers/register_driver_types.h"
#include "global_config.h"
@ -39,7 +39,7 @@
#include "script_debugger_local.h"
#include "script_debugger_remote.h"
#include "servers/register_server_types.h"
#include "splash.h"
#include "splash.gen.h"
#include "input_map.h"
#include "io/resource_loader.h"

View file

@ -29,7 +29,7 @@ def build_shader_header(target, source, env):
name = name.replace(".", "_")
fs = open(str(x), "r")
fd = open(str(x) + ".h", "w")
fd = open(str(x) + ".gen.h", "w")
fd.write("/* this file has been generated by SCons, do not edit! */\n")
fd.write("static const char *" + name + "=\n")
line = fs.readline()
@ -192,7 +192,7 @@ def build_glsl_header(filename):
fs.close()
out_file = filename + ".h"
out_file = filename + ".gen.h"
fd = open(out_file, "w")
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
@ -486,7 +486,7 @@ def build_hlsl_dx9_header(filename):
fs.close()
out_file = filename + ".h"
out_file = filename + ".gen.h"
fd = open(out_file, "w")
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
@ -843,7 +843,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs):
header_data = LegacyGLHeaderStruct()
include_file_in_legacygl_header(filename, header_data, 0)
out_file = filename + ".h"
out_file = filename + ".gen.h"
fd = open(out_file, "w")
enum_constants = []
@ -858,7 +858,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs):
fd.write("#ifndef " + out_file_ifdef + class_suffix + "_120\n")
fd.write("#define " + out_file_ifdef + class_suffix + "_120\n")
out_file_class = out_file_base.replace(".glsl.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
out_file_class = out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
fd.write("\n\n")
fd.write("#include \"" + include + "\"\n\n\n")
fd.write("class " + out_file_class + " : public Shader" + class_suffix + " {\n\n")
@ -1165,7 +1165,7 @@ def update_version():
print("Using custom revision: " + rev)
import version
f = open("core/version_generated.h", "wb")
f = open("core/version_generated.gen.h", "wb")
f.write("#define VERSION_SHORT_NAME " + str(version.short_name) + "\n")
f.write("#define VERSION_NAME " + str(version.name) + "\n")
f.write("#define VERSION_MAJOR " + str(version.major) + "\n")
@ -1224,7 +1224,7 @@ def build_cg_shader(sname):
parse_cg_file("fp_" + sname + ".cg", fp_uniforms, fp_uniform_sizes, fp_conditionals)
fd = open("shader_" + sname + ".cg.h", "w")
fd = open("shader_" + sname + ".cg.gen.h", "w")
fd.write('\n#include "shader_cell.h"\n')
fd.write("\nclass Shader_" + sname + " : public ShaderCell {\n")
@ -1299,7 +1299,7 @@ void unregister_module_types() {
"""
f = open("modules/register_module_types.cpp", "wb")
f = open("modules/register_module_types.gen.cpp", "wb")
f.write(modules_cpp)
return module_list
@ -1527,7 +1527,7 @@ def save_active_platforms(apnames, ap):
str += "};\n"
wf = x + "/logo.h"
wf = x + "/logo.gen.h"
logow = open(wf, "wb")
logow.write(str)

View file

@ -7,7 +7,7 @@ env_modules = env.Clone()
Export('env_modules')
env.modules_sources = [
"register_module_types.cpp",
"register_module_types.gen.cpp",
]
# env.add_source_files(env.modules_sources,"*.cpp")
Export('env')

View file

@ -36,7 +36,7 @@
#include "io/zip_io.h"
#include "os/file_access.h"
#include "os/os.h"
#include "platform/android/logo.h"
#include "platform/android/logo.gen.h"
#include "version.h"
#include <string.h>
#if 0

View file

@ -30,7 +30,7 @@
#include "editor/editor_node.h"
#include "editor_export.h"
#include "io/zip_io.h"
#include "platform/javascript/logo.h"
#include "platform/javascript/logo.gen.h"
#define EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE "webassembly_release.zip"
#define EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG "webassembly_debug.zip"

View file

@ -38,7 +38,7 @@
#include "io/zip_io.h"
#include "os/file_access.h"
#include "os/os.h"
#include "platform/osx/logo.h"
#include "platform/osx/logo.gen.h"
#include "string.h"
#include "version.h"

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor/editor_export.h"
#include "platform/windows/logo.h"
#include "platform/windows/logo.gen.h"
void register_windows_exporter() {

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "export.h"
#include "editor/editor_export.h"
#include "platform/x11/logo.h"
#include "platform/x11/logo.gen.h"
#include "scene/resources/texture.h"
void register_x11_exporter() {

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "canvas_item.h"
#include "core/method_bind_ext.inc"
#include "core/method_bind_ext.gen.inc"
#include "message_queue.h"
#include "os/input.h"
#include "scene/main/canvas_layer.h"

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "tile_map.h"
#include "io/marshalls.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
#include "os/os.h"
#include "servers/physics_2d_server.h"

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "physics_body.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
#include "scene/scene_string_names.h"
void PhysicsBody::_notification(int p_what) {

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "tween.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
void Tween::_add_pending_command(StringName p_key, const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4, const Variant &p_arg5, const Variant &p_arg6, const Variant &p_arg7, const Variant &p_arg8, const Variant &p_arg9, const Variant &p_arg10) {

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "graph_node.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
bool GraphNode::_set(const StringName &p_name, const Variant &p_value) {

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "surface_tool.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
#define _VERTEX_SNAP 0.0001
#define EQ_VERTEX_DIST 0.00001

View file

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "texture.h"
#include "core/method_bind_ext.inc"
#include "core/method_bind_ext.gen.inc"
#include "core/os/os.h"
#include "core_string_names.h"
#include "io/image_loader.h"

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_server.h"
#include "global_config.h"
#include "method_bind_ext.inc"
#include "method_bind_ext.gen.inc"
VisualServer *VisualServer::singleton = NULL;
VisualServer *(*VisualServer::create_func)() = NULL;