diff options
Diffstat (limited to 'methods.py')
| -rw-r--r-- | methods.py | 24 | 
1 files changed, 19 insertions, 5 deletions
diff --git a/methods.py b/methods.py index 9b29eadc16..1afd1ca0d4 100644 --- a/methods.py +++ b/methods.py @@ -334,7 +334,7 @@ def use_windows_spawn_fix(self, platform=None):      # On Windows, due to the limited command line length, when creating a static library      # from a very high number of objects SCons will invoke "ar" once per object file;      # that makes object files with same names to be overwritten so the last wins and -    # the library looses symbols defined by overwritten objects. +    # the library loses symbols defined by overwritten objects.      # By enabling quick append instead of the default mode (replacing), libraries will      # got built correctly regardless the invocation strategy.      # Furthermore, since SCons will rebuild the library from scratch when an object file @@ -478,7 +478,7 @@ def detect_visual_c_compiler_version(tools_env):      # and not scons setup environment (env)... so make sure you call the right environment on it or it will fail to detect      # the proper vc version that will be called -    # There is no flag to give to visual c compilers to set the architecture, ie scons bits argument (32,64,ARM etc) +    # There is no flag to give to visual c compilers to set the architecture, i.e. scons bits argument (32,64,ARM etc)      # There are many different cl.exe files that are run, and each one compiles & links to a different architecture      # As far as I know, the only way to figure out what compiler will be run when Scons calls cl.exe via Program()      # is to check the PATH variable and figure out which one will be called first. Code below does that and returns: @@ -633,7 +633,7 @@ def generate_vs_project(env, num_jobs):                  'call "' + batch_file + '" !plat!',              ] -            # windows allows us to have spaces in paths, so we need +            # 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 @@ -646,6 +646,9 @@ def generate_vs_project(env, num_jobs):                  "-j%s" % num_jobs,              ] +            if env["tests"]: +                common_build_postfix.append("tests=yes") +              if env["custom_modules"]:                  common_build_postfix.append("custom_modules=%s" % env["custom_modules"]) @@ -658,6 +661,8 @@ def generate_vs_project(env, num_jobs):          add_to_vs_project(env, env.modules_sources)          add_to_vs_project(env, env.scene_sources)          add_to_vs_project(env, env.servers_sources) +        if env["tests"]: +            add_to_vs_project(env, env.tests_sources)          add_to_vs_project(env, env.editor_sources)          for header in glob_recursive("**/*.h"): @@ -782,9 +787,18 @@ def get_compiler_version(env):              return None      else:  # TODO: Implement for MSVC          return None -    match = re.search("[0-9]+\.[0-9.]+", version) +    match = re.search( +        "(?:(?<=version )|(?<=\) )|(?<=^))" +        "(?P<major>\d+)" +        "(?:\.(?P<minor>\d*))?" +        "(?:\.(?P<patch>\d*))?" +        "(?:-(?P<metadata1>[0-9a-zA-Z-]*))?" +        "(?:\+(?P<metadata2>[0-9a-zA-Z-]*))?" +        "(?: (?P<date>[0-9]{8}|[0-9]{6})(?![0-9a-zA-Z]))?", +        version, +    )      if match is not None: -        return list(map(int, match.group().split("."))) +        return match.groupdict()      else:          return None  |