[DEV] update to GLD stupid repo compatibility

This commit is contained in:
Edouard DUPIN 2021-11-15 22:47:04 +01:00
parent 5555a74aa4
commit fced469b14
9 changed files with 92 additions and 26 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN

View File

@ -72,7 +72,6 @@ def import_path_local(path, limit_sub_folder, exclude_path = [], base_name = "")
for filename in tmp_list_gld_file:
out.append(os.path.join(path, filename))
debug.extreme_verbose(" Find a file : '" + str(out[-1]) + "'")
need_parse_sub_folder = True
rm_value = -1
# check if we need to parse sub_folder
@ -113,7 +112,6 @@ def import_path_local(path, limit_sub_folder, exclude_path = [], base_name = "")
out.append(elem)
return out
def init():
global is_init;
if is_init == True:

View File

@ -98,6 +98,8 @@ class Module:
self._paths = []
# The module has been already build ...
self._isbuild = False
# add include install path after building package
self._include_header_after = False
# configure default heritage
self._local_heritage = None
# TODO : Do a better dynamic property system => not really versatile
@ -144,6 +146,14 @@ class Module:
self._sub_heritage_list = None
self._generate_file = []
##
## @brief set the header not used for the compilation, thay are copied in the include folder, but they are only used for external library include.
## @param[in] self (handle) Class handle.
## @param[in] calue (boolean) Value of the variable.
##
def set_include_header_after(self, value):
self._include_header_after = value;
##
## @brief Generate a string representing the class (for str(xxx))
## @param[in] self (handle) Class handle
@ -333,8 +343,9 @@ class Module:
return
# list of path that can apear in the output data :
gcov_path_file = []
if self._include_header_after == False:
gcov_path_file.append(target.get_build_path_include(self._name)) # for include (that is installed)
gcov_path_file.append(" " + target.get_build_path_include(self._name))
#gcov_path_file.append(" " + target.get_build_path_include(self._name))
gcov_path_file.append(self._origin_path) # for sources.
gcov_path_file.append(" " + self._origin_path)
# squash header and src...
@ -652,6 +663,7 @@ class Module:
# remove unneded files (NOT folder ...)
tools.clean_directory(include_path, copy_list)
# add the pat to the usable dirrectory
if self._include_header_after == False:
self._add_path(include_path)
# ---------------------------------------------------------------------------
@ -1086,6 +1098,8 @@ class Module:
else:
tools.list_append_to_2(self._flags["local"], type, list)
def add_link_model(self, base_path, libs, static=True, dynamic=True, export=False):
pass
##
## @brief Set the compilation version of the
## @param[in] self (handle) Class handle

View File

@ -54,7 +54,8 @@ list_of_property_module=[
"maintainer",
"version",
"version-id",
"code-quality"
"code-quality",
"header-install-mode"
];
list_of_element_ignored=[
@ -82,8 +83,8 @@ list_of_element_availlable=[
"type":"LIBRARY",
"group-id":"com.atria-soft",
"description":"Ewol tool kit (base: container)",
"licence":"MPL-2",
"licence-file":"file://LICENCE.txt",
"license":"MPL-2",
"license-file":"file://license.txt",
"maintainer":"Edouard DUPIN <yui.heero@gmail.com>",
"author":"file://../authors.txt",
"version":"1.5.3",
@ -117,7 +118,7 @@ list_of_element_availlable=[
"xxx/YuyTer.cpp"
"xxx/plouf.java"
],
"source": {
"source": { # this is the canocical mode ==> mermit to separate the language, otherwise this is auto-detection mode ...
"*": [
...
],
@ -129,26 +130,28 @@ list_of_element_availlable=[
],
"nasm": [
...
],
"java": [
...
],
"javah": [
...
] ...
},
"header-install-mode": "AFTER", # or "BEFORE"<< default is before ==> better to isolate the include folder...
"header": [
"xxx/Yyy.hpp",
"xxx/YuyTer.hpp"
],
"header": {
"header": { # this is the canocical mode ==> mermit to separate the language, otherwise this is auto-detection mode ...
"c": [
"xxx/Yyy.hpp",
"xxx/YuyTer.hpp"
]
},
############## TODO: rename "include"
"path":[
"."
],
"compilation-version": { ## old ==> to remove
"language": "c++",
"version": 2017
},
"compilation-version": {
"c++": 2017,
"java": 16
@ -416,7 +419,31 @@ def parse_node_generic(target, path, json_path, my_module, data, first = False )
if "header" in data.keys():
if type(data["header"]) == list:
my_module.add_header_file(data["header"]);
for elem in data["header"]:
if type(elem) == list:
my_module.add_header_file(elem);
elif type(elem) == str:
my_module.add_header_file(elem);
elif type(elem) == dict:
pass;
#{'path': 'thirdparty/src/', 'filter': '*.h', 'to': 'g3log'}
elem_path = "";
elem_to = "";
elem_recursive = True;
elem_filter = "*"
if "path" in elem:
elem_path = elem["path"];
if "to" in elem:
elem_to = elem["to"];
if "recursive" in elem:
elem_recursive = elem["recursive"];
if "filter" in elem:
elem_filter = elem["filter"];
if elem_path == "":
debug.error("header does not support type of dict: " + str(elem) + " ==> missing 'path'")
my_module.add_header_path(elem_path, regex=elem_filter, clip_path=None, recursive=elem_recursive, destination_path=elem_to);
else:
debug.error("headers does not manage other than string, list and object");
elif type(data["header"]) == dict:
if "list" in data["header"].keys():
my_module.add_header_file(data["header"]["list"]);
@ -428,8 +455,12 @@ def parse_node_generic(target, path, json_path, my_module, data, first = False )
if "path" in data.keys():
if type(data["path"]) == list:
my_module.add_path(data["path"]);
elif type(data["path"]) == dict:
for key in data["path"]:
my_module.add_path(data["path"][key], type = key);
else:
debug.error("Wrong type for node 'path' []");
debug.error("Wrong type for node 'path' [] or {}");
if "dependency" in data.keys():
@ -489,6 +520,29 @@ def load_module_from_GLD(target, name, path, json_path):
my_module._pkg_set_if_default("LICENSE", property["license"])
if property["version"] != None:
my_module._pkg_set_if_default("VERSION", property["version"])
if "header-install-mode" in data.keys():
if data["header-install-mode"] == "AFTER":
my_module.set_include_header_after(True);
elif data["header-install-mode"] == "BEFORE":
my_module.set_include_header_after(False);
else:
debug.warning("can not support for element: 'header-install-mode' other value than [BEFORE,AFTER]");
if "code-quality" in data.keys():
if data["header-install-mode"] == "LOW":
pass;
elif data["header-install-mode"] == "MEDIUM":
pass;
elif data["header-install-mode"] == "HARD":
pass;
elif data["header-install-mode"] == "PROFESSIONAL":
pass;
else:
debug.warning("Does not support other level than [LOW, MEDIUM, HARD, PROFESSIONAL]");
# parsing all the file to configure:
parse_node_generic(target, path, json_path, my_module, data, True);
@ -645,5 +699,5 @@ def get_module_option_GLD(path, data, name):
"group-id":group_id,
"maintainer":maintainer,
"version":version,
"version-id":version_id
"version-id":version_id,
}

View File

@ -109,7 +109,7 @@ class Target:
if "debug" == self.config["mode"]:
self.add_flag("c", [
"-g",
"-DDEBUG"
#"-DDEBUG"
])
if env.get_force_optimisation() == False:
self.add_flag("c", "-O0")
@ -117,7 +117,7 @@ class Target:
self.add_flag("c", "-O3")
else:
self.add_flag("c", [
"-DNDEBUG",
#"-DNDEBUG",
"-O3"
])

View File

@ -22,8 +22,8 @@ class System(system.System):
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend(['c'])
self.add_flag('link-lib', 'Xv')
self.add_flag('link-lib', 'Xt')
#self.add_flag('link-lib', 'Xv')
#self.add_flag('link-lib', 'Xt')
self.add_flag('link-lib', 'X11')
if env.get_isolate_system() == True:
self.add_header_file([

View File

@ -22,7 +22,7 @@ class System(system.System):
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend([
'khr',
# TODO: needed for wayland : 'khr',
])
self.add_flag('link-lib', 'EGL')
if env.get_isolate_system() == True:

View File

@ -22,7 +22,7 @@ class System(system.System):
self.set_valid(True)
# no check needed ==> just add this:
self.add_depend(['c'])
self.add_flag('link-lib', 'xkbcommon')
#self.add_flag('link-lib', 'xkbcommon')
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/xkbcommon/*"

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN