summaryrefslogtreecommitdiff
path: root/methods.py
diff options
context:
space:
mode:
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py53
1 files changed, 35 insertions, 18 deletions
diff --git a/methods.py b/methods.py
index f1ef95f6fe..2be73f02d2 100644
--- a/methods.py
+++ b/methods.py
@@ -1149,24 +1149,28 @@ def build_gles3_headers(target, source, env):
build_legacygl_header(str(x), include="drivers/gles3/shader_gles3.h", class_suffix="GLES3", output_attribs=True)
-def update_version():
+def add_module_version_string(self,s):
+ self.module_version_string += "." + s
- rev = "custom_build"
+def update_version(module_version_string=""):
+
+ build_name = "custom_build"
+ if (os.getenv("BUILD_NAME") != None):
+ build_name = os.getenv("BUILD_NAME")
+ print("Using custom build name: " + build_name)
- if (os.getenv("BUILD_REVISION") != None):
- rev = os.getenv("BUILD_REVISION")
- print("Using custom revision: " + rev)
import version
f = open("core/version_generated.gen.h", "w")
- f.write("#define VERSION_SHORT_NAME " + str(version.short_name) + "\n")
- f.write("#define VERSION_NAME " + str(version.name) + "\n")
+ 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")
f.write("#define VERSION_MINOR " + str(version.minor) + "\n")
if (hasattr(version, 'patch')):
f.write("#define VERSION_PATCH " + str(version.patch) + "\n")
- f.write("#define VERSION_REVISION " + str(rev) + "\n")
- f.write("#define VERSION_STATUS " + str(version.status) + "\n")
+ f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n")
+ f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n")
+ f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n")
import datetime
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")
f.close()
@@ -1289,21 +1293,15 @@ def detect_modules():
// modules.cpp - THIS FILE IS GENERATED, DO NOT EDIT!!!!!!!
#include "register_module_types.h"
-
""" + includes_cpp + """
void register_module_types() {
-
""" + register_cpp + """
-
}
void unregister_module_types() {
-
""" + unregister_cpp + """
-
}
-
"""
f = open("modules/register_module_types.gen.cpp", "w")
@@ -1360,6 +1358,10 @@ def win32_spawn(sh, escape, cmd, args, spawnenv):
return exit_code
"""
+def android_add_flat_dir(self, dir):
+ if (dir not in self.android_flat_dirs):
+ self.android_flat_dirs.append(dir)
+
def android_add_maven_repository(self, url):
if (url not in self.android_maven_repos):
self.android_maven_repos.append(url)
@@ -1684,6 +1686,17 @@ def find_visual_c_batch_file(env):
(host_platform, target_platform,req_target_platform) = get_host_target(env)
return find_batch_file(env, version, host_platform, target_platform)[0]
+def generate_cpp_hint_file(filename):
+ import os.path
+ if os.path.isfile(filename):
+ # Don't overwrite an existing hint file since the user may have customized it.
+ pass
+ else:
+ try:
+ fd = open(filename, "w")
+ fd.write("#define GDCLASS(m_class, m_inherits)\n")
+ except IOError:
+ print("Could not write cpp.hint file.")
def generate_vs_project(env, num_jobs):
batch_file = find_visual_c_batch_file(env)
@@ -1706,9 +1719,13 @@ def generate_vs_project(env, num_jobs):
env.AddToVSProject(env.servers_sources)
env.AddToVSProject(env.editor_sources)
- env['MSVSBUILDCOM'] = build_commandline('scons --directory=$(ProjectDir) platform=windows target=$(Configuration) tools=!tools! -j' + str(num_jobs))
- env['MSVSREBUILDCOM'] = build_commandline('scons --directory=$(ProjectDir) platform=windows target=$(Configuration) tools=!tools! vsproj=yes -j' + str(num_jobs))
- env['MSVSCLEANCOM'] = build_commandline('scons --directory=$(ProjectDir) --clean platform=windows target=$(Configuration) tools=!tools! -j' + str(num_jobs))
+ # windows allows us to have spaces in paths, so we need
+ # to double quote off the directory. However, the path ends
+ # in a backslash, so we need to remove this, lest it escape the
+ # last double quote off, confusing MSBuild
+ env['MSVSBUILDCOM'] = build_commandline('scons --directory="$(ProjectDir.TrimEnd(\'\\\'))" platform=windows progress=no target=$(Configuration) tools=!tools! -j' + str(num_jobs))
+ env['MSVSREBUILDCOM'] = build_commandline('scons --directory="$(ProjectDir.TrimEnd(\'\\\'))" platform=windows progress=no target=$(Configuration) tools=!tools! vsproj=yes -j' + str(num_jobs))
+ env['MSVSCLEANCOM'] = build_commandline('scons --directory="$(ProjectDir.TrimEnd(\'\\\'))" --clean platform=windows progress=no target=$(Configuration) tools=!tools! -j' + str(num_jobs))
# This version information (Win32, x64, Debug, Release, Release_Debug seems to be
# required for Visual Studio to understand that it needs to generate an NMAKE