[DEBUG] correct the compilation with wrong dependency include ==> remove target optimisation
This commit is contained in:
parent
1ec07b9446
commit
87a4106101
81
bin/lutin
81
bin/lutin
@ -11,6 +11,7 @@
|
|||||||
# for path inspection:
|
# for path inspection:
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import copy
|
||||||
import lutin
|
import lutin
|
||||||
import lutin.debug as debug
|
import lutin.debug as debug
|
||||||
import lutin.arg as arguments
|
import lutin.arg as arguments
|
||||||
@ -154,6 +155,15 @@ def usage(full=False):
|
|||||||
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
|
print(" ex: " + sys.argv[0] + " all --target=Android all -t Windows -m debug all")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
def check_boolean(value):
|
||||||
|
if value == "" \
|
||||||
|
or value == "1" \
|
||||||
|
or value == "true" \
|
||||||
|
or value == "True" \
|
||||||
|
or value == True:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
# preparse the argument to get the verbose element for debug mode
|
# preparse the argument to get the verbose element for debug mode
|
||||||
def parseGenericArg(argument, active):
|
def parseGenericArg(argument, active):
|
||||||
debug.extreme_verbose("parse arg : " + argument.get_option_name() + " " + argument.get_arg() + " active=" + str(active))
|
debug.extreme_verbose("parse arg : " + argument.get_option_name() + " " + argument.get_arg() + " active=" + str(active))
|
||||||
@ -201,66 +211,42 @@ def parseGenericArg(argument, active):
|
|||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "color":
|
elif argument.get_option_name() == "color":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
debug.enable_color()
|
debug.enable_color()
|
||||||
else:
|
else:
|
||||||
debug.disable_color()
|
debug.disable_color()
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "force-build":
|
elif argument.get_option_name() == "force-build":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
env.set_force_mode(True)
|
env.set_force_mode(True)
|
||||||
else:
|
else:
|
||||||
env.set_force_mode(False)
|
env.set_force_mode(False)
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "pretty":
|
elif argument.get_option_name() == "pretty":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
env.set_print_pretty_mode(True)
|
env.set_print_pretty_mode(True)
|
||||||
else:
|
else:
|
||||||
env.set_print_pretty_mode(False)
|
env.set_print_pretty_mode(False)
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "force-optimisation":
|
elif argument.get_option_name() == "force-optimisation":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
env.set_force_optimisation(True)
|
env.set_force_optimisation(True)
|
||||||
else:
|
else:
|
||||||
env.set_force_optimisation(False)
|
env.set_force_optimisation(False)
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "force-strip":
|
elif argument.get_option_name() == "force-strip":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
env.set_force_strip_mode(True)
|
env.set_force_strip_mode(True)
|
||||||
else:
|
else:
|
||||||
env.set_force_strip_mode(False)
|
env.set_force_strip_mode(False)
|
||||||
return True
|
return True
|
||||||
elif argument.get_option_name() == "warning":
|
elif argument.get_option_name() == "warning":
|
||||||
if active==True:
|
if active==True:
|
||||||
if argument.get_arg() == "" \
|
if check_boolean(argument.get_arg()) == True:
|
||||||
or argument.get_arg() == "1" \
|
|
||||||
or argument.get_arg() == "true" \
|
|
||||||
or argument.get_arg() == "True" \
|
|
||||||
or argument.get_arg() == True:
|
|
||||||
env.set_warning_mode(True)
|
env.set_warning_mode(True)
|
||||||
else:
|
else:
|
||||||
env.set_warning_mode(False)
|
env.set_warning_mode(False)
|
||||||
@ -326,8 +312,6 @@ config = {
|
|||||||
"gcov":False,
|
"gcov":False,
|
||||||
"compilator-version":""
|
"compilator-version":""
|
||||||
}
|
}
|
||||||
# load the default target :
|
|
||||||
my_target = None
|
|
||||||
actionDone=False
|
actionDone=False
|
||||||
# parse all argument
|
# parse all argument
|
||||||
for argument in localArgument:
|
for argument in localArgument:
|
||||||
@ -349,8 +333,6 @@ for argument in localArgument:
|
|||||||
if config["compilator"] != argument.get_arg():
|
if config["compilator"] != argument.get_arg():
|
||||||
debug.debug("change compilator ==> " + argument.get_arg())
|
debug.debug("change compilator ==> " + argument.get_arg())
|
||||||
config["compilator"] = argument.get_arg()
|
config["compilator"] = argument.get_arg()
|
||||||
#remove previous target
|
|
||||||
my_target = None
|
|
||||||
elif argument.get_option_name() == "target":
|
elif argument.get_option_name() == "target":
|
||||||
# No check input ==> this will be verify automaticly chen the target will be loaded
|
# No check input ==> this will be verify automaticly chen the target will be loaded
|
||||||
if targetName != argument.get_arg():
|
if targetName != argument.get_arg():
|
||||||
@ -367,23 +349,38 @@ for argument in localArgument:
|
|||||||
"gcov":False,
|
"gcov":False,
|
||||||
"compilator-version":""
|
"compilator-version":""
|
||||||
}
|
}
|
||||||
#remove previous target
|
|
||||||
my_target = None
|
|
||||||
elif argument.get_option_name() == "mode":
|
elif argument.get_option_name() == "mode":
|
||||||
if config["mode"] != argument.get_arg():
|
if config["mode"] != argument.get_arg():
|
||||||
config["mode"] = argument.get_arg()
|
config["mode"] = argument.get_arg()
|
||||||
debug.debug("change mode ==> " + config["mode"])
|
debug.debug("change mode ==> " + config["mode"])
|
||||||
#remove previous target
|
|
||||||
my_target = None
|
|
||||||
else:
|
else:
|
||||||
|
argument_value = argument.get_arg()
|
||||||
|
debug.debug("something request : '" + argument_value + "'")
|
||||||
if argument.get_option_name() != "":
|
if argument.get_option_name() != "":
|
||||||
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'")
|
debug.warning("Can not understand argument : '" + argument.get_option_name() + "'")
|
||||||
usage()
|
usage()
|
||||||
|
break;
|
||||||
|
name2 = argument_value.replace("@", "?")
|
||||||
|
gettedElement = name2.split("?")
|
||||||
|
module_name = gettedElement[0]
|
||||||
|
action_list = gettedElement[1:]
|
||||||
|
if len(action_list) == 0:
|
||||||
|
action_list = "build"
|
||||||
|
debug.debug("requested: '" + module_name + "' ? actions:'" + str(action_list) + "'")
|
||||||
|
multiple_module_list = []
|
||||||
|
if module_name[-1] == "*":
|
||||||
|
base_name = module_name[:-1]
|
||||||
|
for mod in module.list_all_module():
|
||||||
|
if mod[:len(base_name)] == base_name:
|
||||||
|
debug.verbose("need do it for: " + mod);
|
||||||
|
multiple_module_list.append(mod)
|
||||||
else:
|
else:
|
||||||
#load the target if needed :
|
multiple_module_list.append(module_name)
|
||||||
if my_target == None:
|
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'")
|
||||||
my_target = target.load_target(targetName, config)
|
for module_name in multiple_module_list:
|
||||||
my_target.build(argument.get_arg())
|
#Load target with specific configuration:
|
||||||
|
my_target = target.load_target(targetName, copy.deepcopy(config))
|
||||||
|
my_target.build(module_name, actions=action_list)
|
||||||
actionDone=True
|
actionDone=True
|
||||||
|
|
||||||
# if no action done : we do "all" ...
|
# if no action done : we do "all" ...
|
||||||
|
204
lutin/target.py
204
lutin/target.py
@ -465,7 +465,17 @@ class Target:
|
|||||||
mod.ext_project_add_module(self, projectMng, addedModule)
|
mod.ext_project_add_module(self, projectMng, addedModule)
|
||||||
return
|
return
|
||||||
|
|
||||||
def build(self, name, packagesName=None, optionnal=False):
|
|
||||||
|
def build(self, name, packagesName=None, optionnal=False, actions=[]):
|
||||||
|
if len(name.split("?")) != 1\
|
||||||
|
or len(name.split("@")) != 1:
|
||||||
|
debug.error("need update")
|
||||||
|
if actions == "":
|
||||||
|
actions = ["build"]
|
||||||
|
if actions == []:
|
||||||
|
actions = ["build"]
|
||||||
|
if type(actions) == str:
|
||||||
|
actions = [action]
|
||||||
if name == "gcov":
|
if name == "gcov":
|
||||||
debug.info("gcov all")
|
debug.info("gcov all")
|
||||||
debug.error("must set the gcov parsing on a specific library or binary ==> not supported now for all")
|
debug.error("must set the gcov parsing on a specific library or binary ==> not supported now for all")
|
||||||
@ -492,114 +502,98 @@ class Target:
|
|||||||
for mod in self.module_list:
|
for mod in self.module_list:
|
||||||
mod.clean(self)
|
mod.clean(self)
|
||||||
else:
|
else:
|
||||||
# get the action an the module ....
|
module_name = name
|
||||||
name2 = name.replace("@", "?")
|
action_list = actions
|
||||||
gettedElement = name2.split("?")
|
for action_name in action_list:
|
||||||
module_name = gettedElement[0]
|
debug.verbose("requested : " + module_name + "?" + action_name + " [START]")
|
||||||
action_list = gettedElement[1:]
|
ret = None;
|
||||||
if len(action_list) == 0:
|
if action_name == "install":
|
||||||
action_list = ["build"]
|
try:
|
||||||
debug.verbose("requested : " + module_name + " ? actions:" + str(action_list))
|
self.install_package(module_name)
|
||||||
multiple_module_list = []
|
except AttributeError:
|
||||||
if module_name[-1] == "*":
|
debug.error("target have no 'install_package' instruction")
|
||||||
base_name = module_name[:-1]
|
elif action_name == "uninstall":
|
||||||
for mod in module.list_all_module():
|
try:
|
||||||
if mod[:len(base_name)] == base_name:
|
self.un_install_package(module_name)
|
||||||
debug.verbose("need do it for: " + mod);
|
except AttributeError:
|
||||||
multiple_module_list.append(mod)
|
debug.error("target have no 'un_install_package' instruction")
|
||||||
else:
|
elif action_name[:3] == "run":
|
||||||
multiple_module_list.append(module_name)
|
if len(action_name) > 3:
|
||||||
for module_name in multiple_module_list:
|
# we have option:
|
||||||
for action_name in action_list:
|
action_name2 = action_name.replace("\:", "1234COLUMN4321")
|
||||||
debug.verbose("requested : " + module_name + "?" + action_name + " [START]")
|
option_list = action_name2.split(":")
|
||||||
ret = None;
|
if len(option_list) == 0:
|
||||||
if action_name == "install":
|
debug.warning("action 'run' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
||||||
try:
|
|
||||||
self.install_package(module_name)
|
|
||||||
except AttributeError:
|
|
||||||
debug.error("target have no 'install_package' instruction")
|
|
||||||
elif action_name == "uninstall":
|
|
||||||
try:
|
|
||||||
self.un_install_package(module_name)
|
|
||||||
except AttributeError:
|
|
||||||
debug.error("target have no 'un_install_package' instruction")
|
|
||||||
elif action_name[:3] == "run":
|
|
||||||
if len(action_name) > 3:
|
|
||||||
# we have option:
|
|
||||||
action_name2 = action_name.replace("\:", "1234COLUMN4321")
|
|
||||||
option_list = action_name2.split(":")
|
|
||||||
if len(option_list) == 0:
|
|
||||||
debug.warning("action 'run' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
|
||||||
option_list = []
|
|
||||||
else:
|
|
||||||
option_list_tmp = option_list[1:]
|
|
||||||
option_list = []
|
|
||||||
for elem in option_list_tmp:
|
|
||||||
option_list.append(elem.replace("1234COLUMN4321", ":"))
|
|
||||||
else:
|
|
||||||
option_list = []
|
option_list = []
|
||||||
#try:
|
|
||||||
self.run(module_name, option_list)
|
|
||||||
#except AttributeError:
|
|
||||||
# debug.error("target have no 'run' instruction")
|
|
||||||
elif action_name == "log":
|
|
||||||
try:
|
|
||||||
self.show_log(module_name)
|
|
||||||
except AttributeError:
|
|
||||||
debug.error("target have no 'show_log' instruction")
|
|
||||||
else:
|
|
||||||
present = self.load_if_needed(module_name, optionnal=optionnal)
|
|
||||||
if present == False \
|
|
||||||
and optionnal == True:
|
|
||||||
ret = [heritage.HeritageList(), False]
|
|
||||||
else:
|
else:
|
||||||
for mod in self.module_list:
|
option_list_tmp = option_list[1:]
|
||||||
if mod.name == module_name:
|
option_list = []
|
||||||
if action_name[:4] == "dump":
|
for elem in option_list_tmp:
|
||||||
debug.info("dump module '" + module_name + "'")
|
option_list.append(elem.replace("1234COLUMN4321", ":"))
|
||||||
if len(action_name) > 4:
|
else:
|
||||||
debug.warning("action 'dump' does not support options ... : '" + action_name + "'")
|
option_list = []
|
||||||
ret = mod.display(self)
|
#try:
|
||||||
break
|
self.run(module_name, option_list)
|
||||||
elif action_name[:5] == "clean":
|
#except AttributeError:
|
||||||
debug.info("clean module '" + module_name + "'")
|
# debug.error("target have no 'run' instruction")
|
||||||
if len(action_name) > 5:
|
elif action_name == "log":
|
||||||
debug.warning("action 'clean' does not support options ... : '" + action_name + "'")
|
try:
|
||||||
ret = mod.clean(self)
|
self.show_log(module_name)
|
||||||
break
|
except AttributeError:
|
||||||
elif action_name[:4] == "gcov":
|
debug.error("target have no 'show_log' instruction")
|
||||||
debug.debug("gcov on module '" + module_name + "'")
|
else:
|
||||||
if len(action_name) > 4:
|
present = self.load_if_needed(module_name, optionnal=optionnal)
|
||||||
# we have option:
|
if present == False \
|
||||||
option_list = action_name.split(":")
|
and optionnal == True:
|
||||||
if len(option_list) == 0:
|
ret = [heritage.HeritageList(), False]
|
||||||
debug.warning("action 'gcov' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
else:
|
||||||
option_list = []
|
for mod in self.module_list:
|
||||||
else:
|
if mod.name == module_name:
|
||||||
option_list = option_list[1:]
|
if action_name[:4] == "dump":
|
||||||
else:
|
debug.info("dump module '" + module_name + "'")
|
||||||
|
if len(action_name) > 4:
|
||||||
|
debug.warning("action 'dump' does not support options ... : '" + action_name + "'")
|
||||||
|
ret = mod.display(self)
|
||||||
|
break
|
||||||
|
elif action_name[:5] == "clean":
|
||||||
|
debug.info("clean module '" + module_name + "'")
|
||||||
|
if len(action_name) > 5:
|
||||||
|
debug.warning("action 'clean' does not support options ... : '" + action_name + "'")
|
||||||
|
ret = mod.clean(self)
|
||||||
|
break
|
||||||
|
elif action_name[:4] == "gcov":
|
||||||
|
debug.debug("gcov on module '" + module_name + "'")
|
||||||
|
if len(action_name) > 4:
|
||||||
|
# we have option:
|
||||||
|
option_list = action_name.split(":")
|
||||||
|
if len(option_list) == 0:
|
||||||
|
debug.warning("action 'gcov' wrong options options ... : '" + action_name + "' might be separate with ':'")
|
||||||
option_list = []
|
option_list = []
|
||||||
if "output" in option_list:
|
|
||||||
ret = mod.gcov(self, generate_output=True)
|
|
||||||
else:
|
else:
|
||||||
ret = mod.gcov(self, generate_output=False)
|
option_list = option_list[1:]
|
||||||
break
|
else:
|
||||||
elif action_name[:5] == "build":
|
option_list = []
|
||||||
if len(action_name) > 5:
|
if "output" in option_list:
|
||||||
debug.warning("action 'build' does not support options ... : '" + action_name + "'")
|
ret = mod.gcov(self, generate_output=True)
|
||||||
debug.debug("build module '" + module_name + "'")
|
else:
|
||||||
if optionnal == True:
|
ret = mod.gcov(self, generate_output=False)
|
||||||
ret = [mod.build(self, None), True]
|
break
|
||||||
else:
|
elif action_name[:5] == "build":
|
||||||
ret = mod.build(self, None)
|
if len(action_name) > 5:
|
||||||
break
|
debug.warning("action 'build' does not support options ... : '" + action_name + "'")
|
||||||
if optionnal == True \
|
debug.debug("build module '" + module_name + "'")
|
||||||
and ret == None:
|
if optionnal == True:
|
||||||
ret = [heritage.HeritageList(), False]
|
ret = [mod.build(self, None), True]
|
||||||
break
|
else:
|
||||||
if ret == None:
|
ret = mod.build(self, None)
|
||||||
debug.error("not know module name : '" + module_name + "' to '" + action_name + "' it")
|
break
|
||||||
debug.verbose("requested : " + module_name + "?" + action_name + " [STOP]")
|
if optionnal == True \
|
||||||
|
and ret == None:
|
||||||
|
ret = [heritage.HeritageList(), False]
|
||||||
|
break
|
||||||
|
if ret == None:
|
||||||
|
debug.error("not know module name : '" + module_name + "' to '" + action_name + "' it")
|
||||||
|
debug.verbose("requested : " + module_name + "?" + action_name + " [STOP]")
|
||||||
if len(action_list) == 1:
|
if len(action_list) == 1:
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user