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