From a509b0861162b4a6ab33b68ddadaa6fa8298fe1b Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 8 May 2015 22:16:25 +0200 Subject: [PATCH] [DEV] change the system config --- bin/lutin | 2 +- lutin/module.py | 47 ++++++++++------------------------------------- lutin/system.py | 10 +++++----- setup.py | 2 +- 4 files changed, 17 insertions(+), 44 deletions(-) diff --git a/bin/lutin b/bin/lutin index feda9ee..431ceee 100755 --- a/bin/lutin +++ b/bin/lutin @@ -94,7 +94,7 @@ def parseGenericArg(argument, active): return True elif argument.get_option_nName()=="jobs": if active==True: - lutinMultiprocess.set_core_number(int(argument.get_arg())) + multiprocess.set_core_number(int(argument.get_arg())) return True elif argument.get_option_nName() == "verbose": if active==True: diff --git a/lutin/module.py b/lutin/module.py index a59cb58..68b0be4 100644 --- a/lutin/module.py +++ b/lutin/module.py @@ -115,7 +115,7 @@ class Module: ## @brief add Some copilation flags for this module (and only this one) ## def add_extra_compile_flags(self): - self.compile_flags_CC([ + self.compile_flags('c', [ "-Wall", "-Wsign-compare", "-Wreturn-type", @@ -130,10 +130,10 @@ class Module: ## @brief remove all unneeded warning on compilation ==> for extern libs ... ## def remove_compile_warning(self): - self.compile_flags_CC([ + self.compile_flags('c', [ "-Wno-int-to-pointer-cast" ]); - self.compile_flags_XX([ + self.compile_flags('c++', [ "-Wno-c++11-narrowing" ]) # only for gcc :"-Wno-unused-but-set-variable" @@ -215,9 +215,9 @@ class Module: # TODO : Add optionnal Flags ... # ==> do it really better ... if export == False: - self.compile_flags_CC("-D"+option); + self.compile_flags(option[0], option[1]); else: - self.add_export_flag_CC("-D"+option); + self.add_export_flag(option[0], option[1]); # add at the heritage list : self.sub_heritage_list.add_heritage_list(inherit_list) for dep in self.depends: @@ -377,7 +377,7 @@ 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="", export=False): + 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): @@ -386,39 +386,12 @@ class Module: def add_path(self, list): self.append_to_internalList(self.path["local"], list) - def add_export_flag_LD(self, list): - self.append_to_internalList2(self.flags["export"], "link", list) - - def add_export_flag_CC(self, list): - self.append_to_internalList2(self.flags["export"], "c", list) - - def add_export_flag_XX(self, list): - self.append_to_internalList2(self.flags["export"], "c++", list) - - def add_export_flag_M(self, list): - self.append_to_internalList2(self.flags["export"], "m", list) - - def add_export_flag_MM(self, list): - self.append_to_internalList2(self.flags["export"], "mm", list) + def add_export_flag(self, type, list): + self.append_to_internalList2(self.flags["export"], type, list) # add the link flag at the module - def compile_flags_LD(self, list): - self.append_to_internalList2(self.flags["local"], "link", list) - - def compile_flags_CC(self, list): - self.append_to_internalList2(self.flags["local"], "c", list) - - def compile_flags_XX(self, list): - self.append_to_internalList2(self.flags["local"], "c++", list) - - def compile_flags_M(self, list): - self.append_to_internalList2(self.flags["local"], "m", list) - - def compile_flags_MM(self, list): - self.append_to_internalList2(self.flags["local"], "mm", list) - - def compile_flags_S(self, list): - self.append_to_internalList2(self.flags["local"], "s", list) + def compile_flags(self, type, list): + self.append_to_internalList2(self.flags["local"], type, list) def compile_version_XX(self, version, same_as_api=True, gnu=False): cpp_version_list = [1999, 2003, 2011, 2014] diff --git a/lutin/system.py b/lutin/system.py index b63a292..e9096c7 100644 --- a/lutin/system.py +++ b/lutin/system.py @@ -69,11 +69,11 @@ class System: def createModuleFromSystem(target, dict): myModule = module.Module(dict["path"], dict["name"], 'PREBUILD') - myModule.add_export_flag_CC(dict["system"].export_flags_cc) - myModule.add_export_flag_LD(dict["system"].export_flags_ld) - myModule.add_export_flag_XX(dict["system"].export_flags_xx) - myModule.add_export_flag_M(dict["system"].export_flags_m) - myModule.add_export_flag_MM(dict["system"].export_flags_mm) + myModule.add_export_flag('c', dict["system"].export_flags_cc) + myModule.add_export_flag('link', dict["system"].export_flags_ld) + myModule.add_export_flag('c++', dict["system"].export_flags_xx) + myModule.add_export_flag('m', dict["system"].export_flags_m) + myModule.add_export_flag('mm', dict["system"].export_flags_mm) # add the currrent module at the return myModule diff --git a/setup.py b/setup.py index 77eb329..5a91a41 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readme(): # https://pypi.python.org/pypi?%3Aaction=list_classifiers setup(name='lutin', - version='0.5.2', + version='0.5.3', description='Lutin generic builder', long_description=readme(), url='http://github.com/HeeroYui/lutin',