diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-29 08:54:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-29 08:54:59 +0100 |
commit | 76725b6c1f73c8d160ad91b42c803a54c78298d4 (patch) | |
tree | bb650e1328d9436d317fdf5d7dd3bdceafe7d588 /methods.py | |
parent | 6a83c8e8edffb84f5c30f4f1ecd705ee213aff4d (diff) | |
parent | a65c0939fd1adc616275ad01996917fab89a7b9c (diff) |
Merge pull request #13387 from rraallvv/refactor
Add target helper functions and refactor (master)
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/methods.py b/methods.py index 0bf5c01462..e861303e63 100644 --- a/methods.py +++ b/methods.py @@ -1495,30 +1495,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.Library(libname + str(num), list) - env.NoCache(lib) + lib = env.add_library(libname + str(num), list) lib_list.append(lib) list = [] num = num + 1 cur_base = base list.append(f) - lib = env.Library(libname + str(num), list) - env.NoCache(lib) + lib = env.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.Library(libname + "_collated", lib_list) - env.NoCache(lib) + lib = env.add_library(libname + "_collated", lib_list) lib_list = [lib] lib_base = [] env.add_source_files(lib_base, "*.cpp") - lib = env.Library(libname, lib_base) - env.NoCache(lib) + lib = env.add_library(libname, lib_base) lib_list.insert(0, lib) env.Prepend(LIBS=lib_list) @@ -1757,3 +1753,18 @@ def precious_program(env, program, sources, **args): program = env.ProgramOriginal(program, sources, **args) env.Precious(program) return program + +def add_shared_library(env, name, sources, **args): + library = env.SharedLibrary(name, sources, **args) + env.NoCache(library) + return library + +def add_library(env, name, sources, **args): + library = env.Library(name, sources, **args) + env.NoCache(library) + return library + +def add_program(env, name, sources, **args): + program = env.Program(name, sources, **args) + env.NoCache(program) + return program |