[DEV] update flags on MacOs
This commit is contained in:
parent
9c9809c359
commit
a2fdd6eef9
@ -410,4 +410,29 @@ def get_maintainer_from_file_or_direct(path_module, filename_or_author):
|
|||||||
# comment ...
|
# comment ...
|
||||||
continue
|
continue
|
||||||
out.append(elem)
|
out.append(elem)
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def remove_element(data, to_remove):
|
||||||
|
base_data = []
|
||||||
|
for elem in data:
|
||||||
|
if type(elem) == list:
|
||||||
|
for elem2 in elem:
|
||||||
|
base_data.append(elem2)
|
||||||
|
else:
|
||||||
|
base_data.append(elem)
|
||||||
|
base_remove = []
|
||||||
|
for elem in to_remove:
|
||||||
|
if type(elem) == list:
|
||||||
|
for elem2 in elem:
|
||||||
|
base_remove.append(elem2)
|
||||||
|
else:
|
||||||
|
base_remove.append(elem)
|
||||||
|
out = []
|
||||||
|
for elem in base_data:
|
||||||
|
if elem not in base_remove:
|
||||||
|
out.append(elem)
|
||||||
|
return out;
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,19 +85,30 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
|||||||
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
cmd.append(get_version_compilation_flags(flags, depancy.flags))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
list_flags = [];
|
||||||
cmd.append(target.global_flags["c"])
|
if "c" in target.global_flags:
|
||||||
except:
|
list_flags.append(target.global_flags["c"])
|
||||||
pass
|
if "c" in depancy.flags:
|
||||||
try:
|
list_flags.append(depancy.flags["c"])
|
||||||
cmd.append(depancy.flags["c"])
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for view in ["local", "export"]:
|
for view in ["local", "export"]:
|
||||||
try:
|
if view in flags:
|
||||||
cmd.append(flags[view]["c"])
|
if "c" in flags[view]:
|
||||||
except:
|
list_flags.append(flags[view]["c"])
|
||||||
pass
|
# get blacklist of flags
|
||||||
|
list_flags_blacklist = [];
|
||||||
|
if "c-remove" in target.global_flags:
|
||||||
|
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||||
|
if "c-remove" in depancy.flags:
|
||||||
|
list_flags_blacklist.append(depancy.flags["c-remove"])
|
||||||
|
for view in ["local", "export"]:
|
||||||
|
if view in flags:
|
||||||
|
if "c-remove" in flags[view]:
|
||||||
|
list_flags_blacklist.append(flags[view]["c-remove"])
|
||||||
|
# apply blacklisting of data and add it on the cmdLine
|
||||||
|
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||||
|
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||||
|
cmd.append(clean_flags);
|
||||||
|
|
||||||
cmd.append("-c")
|
cmd.append("-c")
|
||||||
cmd.append("-MMD")
|
cmd.append("-MMD")
|
||||||
cmd.append("-MP")
|
cmd.append("-MP")
|
||||||
|
@ -54,12 +54,6 @@ def get_output_type():
|
|||||||
def get_support_multithreading():
|
def get_support_multithreading():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def remove_element(data, to_remove):
|
|
||||||
out = []
|
|
||||||
for elem in data:
|
|
||||||
if elem not in to_remove:
|
|
||||||
out.append(elem)
|
|
||||||
return out;
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief Commands for running gcc to compile a C++ file in object file.
|
## @brief Commands for running gcc to compile a C++ file in object file.
|
||||||
@ -94,48 +88,36 @@ def compile(file, binary, target, depancy, flags, path, name, basic_path, module
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
list_flags = [];
|
list_flags = [];
|
||||||
try:
|
if "c" in target.global_flags:
|
||||||
list_flags.append(target.global_flags["c"])
|
list_flags.append(target.global_flags["c"])
|
||||||
except:
|
if "c++" in target.global_flags:
|
||||||
pass
|
|
||||||
try:
|
|
||||||
list_flags.append(target.global_flags["c++"])
|
list_flags.append(target.global_flags["c++"])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for type in ["c", "c++"]:
|
for type in ["c", "c++"]:
|
||||||
try:
|
if type in depancy.flags:
|
||||||
list_flags.append(depancy.flags[type])
|
list_flags.append(depancy.flags[type])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for view in ["local", "export"]:
|
for view in ["local", "export"]:
|
||||||
for type in ["c", "c++"]:
|
if view in flags:
|
||||||
try:
|
for type in ["c", "c++"]:
|
||||||
list_flags.append(flags[view][type])
|
if type in flags[view]:
|
||||||
except:
|
list_flags.append(flags[view][type])
|
||||||
pass
|
|
||||||
# get blacklist of flags
|
# get blacklist of flags
|
||||||
list_flags_blacklist = [];
|
list_flags_blacklist = [];
|
||||||
try:
|
if "c-remove" in target.global_flags:
|
||||||
list_flags_blacklist.append(target.global_flags["c-remove"])
|
list_flags_blacklist.append(target.global_flags["c-remove"])
|
||||||
except:
|
if "c++-remove" in target.global_flags:
|
||||||
pass
|
|
||||||
try:
|
|
||||||
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
list_flags_blacklist.append(target.global_flags["c++-remove"])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for type in ["c-remove", "c++-remove"]:
|
for type in ["c-remove", "c++-remove"]:
|
||||||
try:
|
if type in depancy.flags:
|
||||||
list_flags_blacklist.append(depancy.flags[type])
|
list_flags_blacklist.append(depancy.flags[type])
|
||||||
except:
|
|
||||||
pass
|
|
||||||
for view in ["local", "export"]:
|
for view in ["local", "export"]:
|
||||||
for type in ["c-remove", "c++-remove"]:
|
if view in flags:
|
||||||
try:
|
for type in ["c-remove", "c++-remove"]:
|
||||||
list_flags_blacklist.append(flags[view][type])
|
if type in flags[view]:
|
||||||
except:
|
list_flags_blacklist.append(flags[view][type])
|
||||||
pass
|
|
||||||
# apply blacklisting of data and add it on the cmdLine
|
# apply blacklisting of data and add it on the cmdLine
|
||||||
cmd.append(remove_element(list_flags, list_flags_blacklist));
|
clean_flags = tools.remove_element(list_flags, list_flags_blacklist)
|
||||||
|
#debug.warning("plop " + str(list_flags_blacklist) + " " + str(list_flags) + " --> " + str(clean_flags) )
|
||||||
|
cmd.append(clean_flags);
|
||||||
cmd.append(["-c", "-MMD", "-MP"])
|
cmd.append(["-c", "-MMD", "-MP"])
|
||||||
cmd.append(file_src)
|
cmd.append(file_src)
|
||||||
# Create cmd line
|
# Create cmd line
|
||||||
|
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
24
lutin/z_system/lutinSystem_MacOs_c.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##
|
||||||
|
## @author Edouard DUPIN
|
||||||
|
##
|
||||||
|
## @copyright 2012, Edouard DUPIN, all right reserved
|
||||||
|
##
|
||||||
|
## @license APACHE v2.0 (see license file)
|
||||||
|
##
|
||||||
|
|
||||||
|
from lutin import debug
|
||||||
|
from lutin import system
|
||||||
|
from lutin import tools
|
||||||
|
from lutin import env
|
||||||
|
import os
|
||||||
|
|
||||||
|
class System(system.System):
|
||||||
|
def __init__(self, target):
|
||||||
|
system.System.__init__(self)
|
||||||
|
# create some HELP:
|
||||||
|
self.set_help("C: Generic C library")
|
||||||
|
self.add_flag("c-remove","-nodefaultlibs")
|
||||||
|
self.set_valid(True)
|
||||||
|
|
@ -21,6 +21,7 @@ class System(system.System):
|
|||||||
self.set_help("CXX: Generic C++ library")
|
self.set_help("CXX: Generic C++ library")
|
||||||
self.set_valid(True)
|
self.set_valid(True)
|
||||||
# no check needed ==> just add this:
|
# no check needed ==> just add this:
|
||||||
|
self.add_depend("c")
|
||||||
self.add_flag("c++","-D__STDCPP_LLVM__")
|
self.add_flag("c++","-D__STDCPP_LLVM__")
|
||||||
self.add_flag("c++-remove","-nostdlib")
|
self.add_flag("c++-remove","-nostdlib")
|
||||||
self.add_flag("need-libstdc++", True)
|
self.add_flag("need-libstdc++", True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user