[DEV] add dependency of generic module
This commit is contained in:
parent
91b0cecc28
commit
e3a2e19fe6
@ -8,6 +8,7 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import copy
|
||||||
import lutinDebug as debug
|
import lutinDebug as debug
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +128,7 @@ class heritage:
|
|||||||
if type(module) != type(None):
|
if type(module) != type(None):
|
||||||
# all the parameter that the upper classe need when build
|
# all the parameter that the upper classe need when build
|
||||||
self.name = module.name
|
self.name = module.name
|
||||||
self.depends = module.depends
|
self.depends = copy.deepcopy(module.depends)
|
||||||
self.flags_ld = module.export_flags_ld
|
self.flags_ld = module.export_flags_ld
|
||||||
self.flags_cc = module.export_flags_cc
|
self.flags_cc = module.export_flags_cc
|
||||||
self.flags_xx = module.export_flags_xx
|
self.flags_xx = module.export_flags_xx
|
||||||
@ -135,6 +136,9 @@ class heritage:
|
|||||||
self.flags_mm = module.export_flags_mm
|
self.flags_mm = module.export_flags_mm
|
||||||
self.path = module.export_path
|
self.path = module.export_path
|
||||||
|
|
||||||
|
def add_depends(self, depend):
|
||||||
|
self.depends.append(depend)
|
||||||
|
|
||||||
def add_flag_LD(self, list):
|
def add_flag_LD(self, list):
|
||||||
append_to_list(self.flags_ld, list)
|
append_to_list(self.flags_ld, list)
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class Module:
|
|||||||
self.depends = []
|
self.depends = []
|
||||||
# Dependency list (optionnal module):
|
# Dependency list (optionnal module):
|
||||||
self.depends_optionnal = []
|
self.depends_optionnal = []
|
||||||
|
self.depends_find = []
|
||||||
# Documentation list:
|
# Documentation list:
|
||||||
self.documentation = None
|
self.documentation = None
|
||||||
# export PATH
|
# export PATH
|
||||||
@ -457,12 +458,16 @@ class Module:
|
|||||||
listSubFileNeededTobuild = []
|
listSubFileNeededTobuild = []
|
||||||
self.subHeritageList = heritage.HeritageList()
|
self.subHeritageList = heritage.HeritageList()
|
||||||
# optionnal dependency :
|
# optionnal dependency :
|
||||||
for dep, option in self.depends_optionnal:
|
for dep, option, export in self.depends_optionnal:
|
||||||
inheritList, isBuilt = target.build_optionnal(dep, packageName)
|
inheritList, isBuilt = target.build_optionnal(dep, packageName)
|
||||||
if isBuilt == True:
|
if isBuilt == True:
|
||||||
|
self.localHeritage.add_depends(dep);
|
||||||
# TODO : Add optionnal Flags ...
|
# TODO : Add optionnal Flags ...
|
||||||
# ==> do it really better ...
|
# ==> do it really better ...
|
||||||
self.add_export_flag_CC("-D"+option);
|
if export == False:
|
||||||
|
self.compile_flags_CC("-D"+option);
|
||||||
|
else:
|
||||||
|
self.add_export_flag_CC("-D"+option);
|
||||||
# add at the heritage list :
|
# add at the heritage list :
|
||||||
self.subHeritageList.add_heritage_list(inheritList)
|
self.subHeritageList.add_heritage_list(inheritList)
|
||||||
for dep in self.depends:
|
for dep in self.depends:
|
||||||
@ -579,8 +584,8 @@ class Module:
|
|||||||
def add_module_depend(self, list):
|
def add_module_depend(self, list):
|
||||||
self.append_to_internalList(self.depends, list, True)
|
self.append_to_internalList(self.depends, list, True)
|
||||||
|
|
||||||
def add_optionnal_module_depend(self, module_name, compilation_flags=""):
|
def add_optionnal_module_depend(self, module_name, compilation_flags="", export=False):
|
||||||
self.append_and_check(self.depends_optionnal, [module_name, compilation_flags], True)
|
self.append_and_check(self.depends_optionnal, [module_name, compilation_flags, export], True)
|
||||||
|
|
||||||
def add_export_path(self, list):
|
def add_export_path(self, list):
|
||||||
self.append_to_internalList(self.export_path, list)
|
self.append_to_internalList(self.export_path, list)
|
||||||
@ -784,6 +789,13 @@ def import_path(path):
|
|||||||
debug.debug("integrate module: '" + moduleName + "' from '" + os.path.join(root, filename) + "'")
|
debug.debug("integrate module: '" + moduleName + "' from '" + os.path.join(root, filename) + "'")
|
||||||
moduleList.append([moduleName,os.path.join(root, filename)])
|
moduleList.append([moduleName,os.path.join(root, filename)])
|
||||||
|
|
||||||
|
def exist(target, name):
|
||||||
|
global moduleList
|
||||||
|
for mod in moduleList:
|
||||||
|
if mod[0] == name:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def load_module(target, name):
|
def load_module(target, name):
|
||||||
global moduleList
|
global moduleList
|
||||||
for mod in moduleList:
|
for mod in moduleList:
|
||||||
|
@ -313,6 +313,11 @@ class Target:
|
|||||||
if exist == True:
|
if exist == True:
|
||||||
lutinSystem.load(self, name, self.name)
|
lutinSystem.load(self, name, self.name)
|
||||||
return True;
|
return True;
|
||||||
|
# try to find in the local Modules:
|
||||||
|
exist = lutinModule.exist(self, name)
|
||||||
|
if exist == True:
|
||||||
|
lutinModule.load_module(self, name)
|
||||||
|
return True;
|
||||||
else:
|
else:
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user