- Improves portability in joystick buttons enum

- Fixes linking bug in modules split library
This commit is contained in:
Ariel Manzur 2018-01-24 19:06:35 -03:00
parent 81d7b01596
commit 81426ff0a8
3 changed files with 17 additions and 10 deletions

View File

@ -110,8 +110,8 @@ enum JoystickList {
JOY_WII_C = JOY_BUTTON_5, JOY_WII_C = JOY_BUTTON_5,
JOY_WII_Z = JOY_BUTTON_6, JOY_WII_Z = JOY_BUTTON_6,
JOY_WII_MINUS = JOY_BUTTON_9, JOY_WII_MINUS = JOY_BUTTON_10,
JOY_WII_PLUS = JOY_BUTTON_10, JOY_WII_PLUS = JOY_BUTTON_11,
// end of history // end of history

View File

@ -1477,7 +1477,7 @@ def use_windows_spawn_fix(self, platform=None):
self['SPAWN'] = mySpawn self['SPAWN'] = mySpawn
def split_lib(self, libname): def split_lib(self, libname, src_list = None, env_lib = None):
import string import string
env = self env = self
@ -1487,7 +1487,13 @@ def split_lib(self, libname):
list = [] list = []
lib_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 = "" fname = ""
if type(f) == type(""): if type(f) == type(""):
fname = env.File(f).path fname = env.File(f).path
@ -1497,26 +1503,27 @@ def split_lib(self, libname):
base = string.join(fname.split("/")[:2], "/") base = string.join(fname.split("/")[:2], "/")
if base != cur_base and len(list) > max_src: if base != cur_base and len(list) > max_src:
if num > 0: if num > 0:
lib = env.add_library(libname + str(num), list) lib = env_lib.add_library(libname + str(num), list)
print("adding library ", libname, num)
lib_list.append(lib) lib_list.append(lib)
list = [] list = []
num = num + 1 num = num + 1
cur_base = base cur_base = base
list.append(f) list.append(f)
lib = env.add_library(libname + str(num), list) lib = env_lib.add_library(libname + str(num), list)
lib_list.append(lib) lib_list.append(lib)
if len(lib_list) > 0: if len(lib_list) > 0:
import os, sys import os, sys
if os.name == 'posix' and sys.platform == 'msys': if os.name == 'posix' and sys.platform == 'msys':
env.Replace(ARFLAGS=['rcsT']) 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_list = [lib]
lib_base = [] lib_base = []
env.add_source_files(lib_base, "*.cpp") env_lib.add_source_files(lib_base, "*.cpp")
lib = env.add_library(libname, lib_base) lib = env_lib.add_library(libname, lib_base)
lib_list.insert(0, lib) lib_list.insert(0, lib)
env.Prepend(LIBS=lib_list) env.Prepend(LIBS=lib_list)

View File

@ -18,7 +18,7 @@ for x in env.module_list:
SConscript(x + "/SCsub") SConscript(x + "/SCsub")
if env.split_modules: if env.split_modules:
env.split_lib("modules") env.split_lib("modules", env_lib = env_modules)
else: else:
lib = env_modules.add_library("modules", env.modules_sources) lib = env_modules.add_library("modules", env.modules_sources)