[DEV] Add C++ 17 and better support for Android platform

This commit is contained in:
Edouard DUPIN 2015-09-24 21:48:32 +02:00
parent 663188773d
commit 54fddc82b5
5 changed files with 45 additions and 15 deletions

View File

@ -46,7 +46,7 @@ def enable_color():
global color_yellow
color_yellow = "\033[33m"
global color_blue
color_blue = "\033[34m"
color_blue = "\033[01;34m"
global color_purple
color_purple = "\033[35m"
global color_cyan

View File

@ -689,7 +689,7 @@ class Module:
self.append_to_internal_list2(self.flags["local"], type, list)
def compile_version_XX(self, version, same_as_api=True, gnu=False):
cpp_version_list = [1999, 2003, 2011, 2014]
cpp_version_list = [1999, 2003, 2011, 2014, 2017]
if version not in cpp_version_list:
debug.error("can not select CPP version : " + str(version) + " not in " + str(cpp_version_list))
# select API version:
@ -740,11 +740,15 @@ class Module:
def copy_path(self, source, destination=''):
self.paths.append([source, destination])
def print_list(self, description, list):
if len(list) > 0:
def print_list(self, description, input_list):
if type(input_list) == list:
if len(input_list) > 0:
print(' ' + str(description))
for elem in input_list:
print(' ' + str(elem))
else:
print(' ' + str(description))
for elem in list:
print(' ' + str(elem))
print(' ' + str(input_list))
def display(self, target):
print('-----------------------------------------------')
@ -759,22 +763,22 @@ class Module:
for element in self.flags["local"]:
value = self.flags["local"][element]
self.print_list('flags ' + element, value)
self.print_list('flags "' + str(element) + '"', value)
for element in self.flags["export"]:
value = self.flags["export"][element]
self.print_list('flags export ' + element, value)
self.print_list('flags export "' + str(element) + '"', value)
self.print_list('src',self.src)
self.print_list('files',self.files)
self.print_list('paths',self.paths)
for element in self.path["local"]:
value = self.path["local"][element]
self.print_list('local path ' + element, value)
self.print_list('local path ' + str(element), value)
for element in self.path["export"]:
value = self.path["export"][element]
self.print_list('export path ' + element, value)
self.print_list('export path ' + str(element), value)
def pkg_set(self, variable, value):

View File

@ -115,8 +115,13 @@ def get_version_compilation_flags(flags, dependency_flags):
is_gnu = default_version_gnu
version = max(version_local, dependency_version)
if version == 2017:
debug.error("not supported flags for X17 ...");
if is_gnu == True:
out = ["-std=gnu++17", "-D__CPP_VERSION__=2017"]
else:
out = ["-std=c++17", "-D__CPP_VERSION__=2017"]
if version == 2014:
debug.error("not supported flags for X14 ...");
if is_gnu == True:
out = ["-std=gnu++14", "-D__CPP_VERSION__=2014"]
else:

View File

@ -91,7 +91,8 @@ def link(file, binary, target, depancy, name, basic_path, static=False):
lib_name = elem[len(lib_path)+len(target.prefix_lib)+1:-len(target.suffix_lib_dynamic)]
cmd.append("-L" + lib_path)
cmd.append("-l" + lib_name)
if target.name != "MacOs":
if target != "MacOs" \
and target.name != "Android":
if len(list_dynamic) > 0:
cmd.append("-Wl,-R$ORIGIN/../lib/")
except:

View File

@ -214,7 +214,29 @@ class Target(target.Target):
"""
def make_package(self, pkg_name, pkg_properties, base_pkg_path, heritage_list):
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
#The package generated depend of the type of the element:
end_point_module_name = heritage_list.list_heritage[-1].name
module = self.get_module(end_point_module_name)
if module == None:
debug.error("can not create package ... ");
if module.get_type() == 'PREBUILD':
#nothing to do ...
return
if module.get_type() == 'LIBRARY' \
or module.get_type() == 'LIBRARY_DYNAMIC' \
or module.get_type() == 'LIBRARY_STATIC':
debug.info("Can not create package for library");
return
if module.get_type() == 'BINARY' \
or module.get_type() == 'BINARY_STAND_ALONE':
self.make_package_generic_binary(pkg_name, pkg_properties, base_pkg_path, heritage_list, static = True)
if module.get_type() == 'BINARY_SHARED':
self.make_package_generic_binary(pkg_name, pkg_properties, base_pkg_path, heritage_list, static = False)
if module.get_type() == 'PACKAGE':
debug.info("Can not create package for package");
return
def make_package_generic_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
debug.debug("------------------------------------------------------------------------")
debug.info("Generate package '" + pkg_name + "'")
debug.debug("------------------------------------------------------------------------")
@ -223,8 +245,6 @@ class Target(target.Target):
target_outpath = self.get_staging_path(pkg_name)
tools.create_directory_of_file(target_outpath)
# TODO : Remove :
static = True
## Create share datas
if static == True:
target_outpath_data = os.path.join(target_outpath, self.pkg_path_data, pkg_name)