Merge pull request #19695 from rraallvv/nocache_gen_master

Add NoCache wrapper to Command (master)
This commit is contained in:
Rémi Verschelde 2018-06-22 09:44:45 +02:00 committed by GitHub
commit 8bf5b50222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 14 deletions

View file

@ -118,6 +118,7 @@ env_base.__class__.split_lib = methods.split_lib
env_base.__class__.add_shared_library = methods.add_shared_library env_base.__class__.add_shared_library = methods.add_shared_library
env_base.__class__.add_library = methods.add_library env_base.__class__.add_library = methods.add_library
env_base.__class__.add_program = methods.add_program env_base.__class__.add_program = methods.add_program
env_base.__class__.CommandNoCache = methods.CommandNoCache
env_base["x86_libtheora_opt_gcc"] = False env_base["x86_libtheora_opt_gcc"] = False
env_base["x86_libtheora_opt_vc"] = False env_base["x86_libtheora_opt_vc"] = False

View file

@ -93,19 +93,19 @@ env.add_source_files(env.core_sources, "*.cpp")
# Make binders # Make binders
import make_binders import make_binders
env.Command(['method_bind.gen.inc', 'method_bind_ext.gen.inc'], 'make_binders.py', make_binders.run) env.CommandNoCache(['method_bind.gen.inc', 'method_bind_ext.gen.inc'], 'make_binders.py', make_binders.run)
# Authors # Authors
env.Depends('#core/authors.gen.h', "../AUTHORS.md") env.Depends('#core/authors.gen.h', "../AUTHORS.md")
env.Command('#core/authors.gen.h', "../AUTHORS.md", methods.make_authors_header) env.CommandNoCache('#core/authors.gen.h', "../AUTHORS.md", methods.make_authors_header)
# Donors # Donors
env.Depends('#core/donors.gen.h', "../DONORS.md") env.Depends('#core/donors.gen.h', "../DONORS.md")
env.Command('#core/donors.gen.h', "../DONORS.md", methods.make_donors_header) env.CommandNoCache('#core/donors.gen.h', "../DONORS.md", methods.make_donors_header)
# License # License
env.Depends('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"]) env.Depends('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.Command('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], methods.make_license_header) env.CommandNoCache('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], methods.make_license_header)
# Chain load SCsubs # Chain load SCsubs
SConscript('os/SCsub') SConscript('os/SCsub')

View file

@ -192,10 +192,10 @@ if env['tools']:
docs = sorted(docs) docs = sorted(docs)
env.Depends("#editor/doc_data_compressed.gen.h", docs) env.Depends("#editor/doc_data_compressed.gen.h", docs)
env.Command("#editor/doc_data_compressed.gen.h", docs, make_doc_header) env.CommandNoCache("#editor/doc_data_compressed.gen.h", docs, make_doc_header)
# Certificates # Certificates
env.Depends("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt") 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) env.CommandNoCache("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header)
import glob import glob
path = env.Dir('.').abspath path = env.Dir('.').abspath
@ -203,13 +203,13 @@ if env['tools']:
# Translations # Translations
tlist = glob.glob(path + "/translations/*.po") tlist = glob.glob(path + "/translations/*.po")
env.Depends('#editor/translations.gen.h', tlist) env.Depends('#editor/translations.gen.h', tlist)
env.Command('#editor/translations.gen.h', tlist, make_translations_header) env.CommandNoCache('#editor/translations.gen.h', tlist, make_translations_header)
# Fonts # Fonts
flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") flist = glob.glob(path + "/../thirdparty/fonts/*.ttf")
flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf")) flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf"))
env.Depends('#editor/builtin_fonts.gen.h', flist) env.Depends('#editor/builtin_fonts.gen.h', flist)
env.Command('#editor/builtin_fonts.gen.h', flist, make_fonts_header) env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, make_fonts_header)
env.add_source_files(env.editor_sources, "*.cpp") env.add_source_files(env.editor_sources, "*.cpp")
env.add_source_files(env.editor_sources, ["#thirdparty/misc/clipper.cpp"]) env.add_source_files(env.editor_sources, ["#thirdparty/misc/clipper.cpp"])

View file

@ -131,20 +131,20 @@ env.add_source_files(env.main_sources, "*.cpp")
controller_databases = ["#main/gamecontrollerdb.txt", "#main/gamecontrollerdb_205.txt", "#main/gamecontrollerdb_204.txt", "#main/godotcontrollerdb.txt"] controller_databases = ["#main/gamecontrollerdb.txt", "#main/gamecontrollerdb_205.txt", "#main/gamecontrollerdb_204.txt", "#main/godotcontrollerdb.txt"]
env.Depends("#main/default_controller_mappings.gen.cpp", controller_databases) env.Depends("#main/default_controller_mappings.gen.cpp", controller_databases)
env.Command("#main/default_controller_mappings.gen.cpp", controller_databases, make_default_controller_mappings) env.CommandNoCache("#main/default_controller_mappings.gen.cpp", controller_databases, make_default_controller_mappings)
env.main_sources.append("#main/default_controller_mappings.gen.cpp") env.main_sources.append("#main/default_controller_mappings.gen.cpp")
Export('env') Export('env')
env.Depends("#main/splash.gen.h", "#main/splash.png") env.Depends("#main/splash.gen.h", "#main/splash.png")
env.Command("#main/splash.gen.h", "#main/splash.png", make_splash) env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", make_splash)
env.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png") env.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png")
env.Command("#main/splash_editor.gen.h", "#main/splash_editor.png", make_splash_editor) env.CommandNoCache("#main/splash_editor.gen.h", "#main/splash_editor.png", make_splash_editor)
env.Depends("#main/app_icon.gen.h", "#main/app_icon.png") 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) env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", make_app_icon)
SConscript('tests/SCsub') SConscript('tests/SCsub')

View file

@ -1329,3 +1329,8 @@ def add_program(env, name, sources, **args):
program = env.Program(name, sources, **args) program = env.Program(name, sources, **args)
env.NoCache(program) env.NoCache(program)
return program return program
def CommandNoCache(env, target, sources, command, **args):
result = env.Command(target, sources, command, **args)
env.NoCache(result)
return result

View file

@ -196,7 +196,7 @@ def build_gdnative_api_struct(target, source, env):
with open(source.path, 'w') as fd: with open(source.path, 'w') as fd:
fd.write(_build_gdnative_api_struct_source(api)) fd.write(_build_gdnative_api_struct_source(api))
_, gensource = gdn_env.Command(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'], _, gensource = gdn_env.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'],
'gdnative_api.json', build_gdnative_api_struct) 'gdnative_api.json', build_gdnative_api_struct)
gdn_env.add_source_files(env.modules_sources, [gensource]) gdn_env.add_source_files(env.modules_sources, [gensource])
@ -277,7 +277,7 @@ def build_gdnative_wrapper_code(target, source, env):
if ARGUMENTS.get('gdnative_wrapper', False): if ARGUMENTS.get('gdnative_wrapper', False):
#build wrapper code #build wrapper code
gensource, = gdn_env.Command('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', build_gdnative_wrapper_code) gensource, = gdn_env.CommandNoCache('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', build_gdnative_wrapper_code)
gd_wrapper_env = env.Clone() gd_wrapper_env = env.Clone()
gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/']) gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/'])