summaryrefslogtreecommitdiff
path: root/methods.py
diff options
context:
space:
mode:
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/methods.py b/methods.py
index 892fa8cfc3..f4d33fb6d8 100644
--- a/methods.py
+++ b/methods.py
@@ -1477,7 +1477,7 @@ def use_windows_spawn_fix(self, platform=None):
self['SPAWN'] = mySpawn
-def split_lib(self, libname):
+def split_lib(self, libname, src_list = None, env_lib = None):
import string
env = self
@@ -1487,7 +1487,13 @@ def split_lib(self, libname):
list = []
lib_list = []
- for f in getattr(env, libname + "_sources"):
+ if src_list == None:
+ src_list = getattr(env, libname + "_sources")
+
+ if type(env_lib) == type(None):
+ env_lib = env
+
+ for f in src_list:
fname = ""
if type(f) == type(""):
fname = env.File(f).path
@@ -1497,26 +1503,26 @@ def split_lib(self, libname):
base = string.join(fname.split("/")[:2], "/")
if base != cur_base and len(list) > max_src:
if num > 0:
- lib = env.add_library(libname + str(num), list)
+ lib = env_lib.add_library(libname + str(num), list)
lib_list.append(lib)
list = []
num = num + 1
cur_base = base
list.append(f)
- lib = env.add_library(libname + str(num), list)
+ lib = env_lib.add_library(libname + str(num), list)
lib_list.append(lib)
if len(lib_list) > 0:
import os, sys
if os.name == 'posix' and sys.platform == 'msys':
env.Replace(ARFLAGS=['rcsT'])
- lib = env.add_library(libname + "_collated", lib_list)
+ lib = env_lib.add_library(libname + "_collated", lib_list)
lib_list = [lib]
lib_base = []
- env.add_source_files(lib_base, "*.cpp")
- lib = env.add_library(libname, lib_base)
+ env_lib.add_source_files(lib_base, "*.cpp")
+ lib = env_lib.add_library(libname, lib_base)
lib_list.insert(0, lib)
env.Prepend(LIBS=lib_list)
@@ -1598,7 +1604,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
- # These 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, ie 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 bellow does that and returns: