|
|
@ -61,12 +61,14 @@ class Host(InterpreterObject): |
|
|
|
return sys.byteorder != 'little' |
|
|
|
return sys.byteorder != 'little' |
|
|
|
|
|
|
|
|
|
|
|
class IncludeDirs(InterpreterObject): |
|
|
|
class IncludeDirs(InterpreterObject): |
|
|
|
def __init__(self, curdir, dirs): |
|
|
|
def __init__(self, curdir, dirs, kwargs): |
|
|
|
InterpreterObject.__init__(self) |
|
|
|
InterpreterObject.__init__(self) |
|
|
|
self.curdir = curdir |
|
|
|
self.curdir = curdir |
|
|
|
self.incdirs = dirs |
|
|
|
self.incdirs = dirs |
|
|
|
# Fixme: check that the directories actually exist. |
|
|
|
# Fixme: check that the directories actually exist. |
|
|
|
# Also that they don't contain ".." or somesuch. |
|
|
|
# Also that they don't contain ".." or somesuch. |
|
|
|
|
|
|
|
if len(kwargs) > 0: |
|
|
|
|
|
|
|
raise InvalidCode('Includedirs function does not take keyword arguments.') |
|
|
|
|
|
|
|
|
|
|
|
def get_curdir(self): |
|
|
|
def get_curdir(self): |
|
|
|
return self.curdir |
|
|
|
return self.curdir |
|
|
@ -155,7 +157,6 @@ class BuildTarget(InterpreterObject): |
|
|
|
self.external_deps = [] |
|
|
|
self.external_deps = [] |
|
|
|
self.include_dirs = [] |
|
|
|
self.include_dirs = [] |
|
|
|
self.methods.update({'add_dep': self.add_dep_method, |
|
|
|
self.methods.update({'add_dep': self.add_dep_method, |
|
|
|
'add_include_dirs': self.add_include_dirs_method, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
self.link_targets = [] |
|
|
|
self.link_targets = [] |
|
|
|
self.filename = 'no_name' |
|
|
|
self.filename = 'no_name' |
|
|
@ -187,6 +188,10 @@ class BuildTarget(InterpreterObject): |
|
|
|
self.set_version(kwargs['version']) |
|
|
|
self.set_version(kwargs['version']) |
|
|
|
if 'soversion' in kwargs: |
|
|
|
if 'soversion' in kwargs: |
|
|
|
self.set_soversion(kwargs['soversion']) |
|
|
|
self.set_soversion(kwargs['soversion']) |
|
|
|
|
|
|
|
inclist = kwargs.get('include_dirs', []) |
|
|
|
|
|
|
|
if not isinstance(inclist, list): |
|
|
|
|
|
|
|
inclist = [inclist] |
|
|
|
|
|
|
|
self.add_include_dirs(inclist) |
|
|
|
|
|
|
|
|
|
|
|
def get_subdir(self): |
|
|
|
def get_subdir(self): |
|
|
|
return self.subdir |
|
|
|
return self.subdir |
|
|
@ -243,7 +248,7 @@ class BuildTarget(InterpreterObject): |
|
|
|
for a in pchlist: |
|
|
|
for a in pchlist: |
|
|
|
self.pch.append(a) |
|
|
|
self.pch.append(a) |
|
|
|
|
|
|
|
|
|
|
|
def add_include_dirs_method(self, args): |
|
|
|
def add_include_dirs(self, args): |
|
|
|
for a in args: |
|
|
|
for a in args: |
|
|
|
if not isinstance(a, IncludeDirs): |
|
|
|
if not isinstance(a, IncludeDirs): |
|
|
|
raise InvalidArguments('Include directory to be added is not an include directory object.') |
|
|
|
raise InvalidArguments('Include directory to be added is not an include directory object.') |
|
|
@ -525,11 +530,11 @@ class Interpreter(): |
|
|
|
c = ConfigureFile(self.subdir, args[0], args[1], kwargs) |
|
|
|
c = ConfigureFile(self.subdir, args[0], args[1], kwargs) |
|
|
|
self.build.configure_files.append(c) |
|
|
|
self.build.configure_files.append(c) |
|
|
|
|
|
|
|
|
|
|
|
def func_include_directories(self, node, args): |
|
|
|
def func_include_directories(self, node, args, kwargs): |
|
|
|
for a in args: |
|
|
|
for a in args: |
|
|
|
if not isinstance(a, str): |
|
|
|
if not isinstance(a, str): |
|
|
|
raise InvalidArguments('Line %d: Argument %s is not a string.' % (node.lineno(), str(a))) |
|
|
|
raise InvalidArguments('Line %d: Argument %s is not a string.' % (node.lineno(), str(a))) |
|
|
|
i = IncludeDirs(self.subdir, args) |
|
|
|
i = IncludeDirs(self.subdir, args, kwargs) |
|
|
|
return i |
|
|
|
return i |
|
|
|
|
|
|
|
|
|
|
|
def func_add_global_arguments(self, node, args): |
|
|
|
def func_add_global_arguments(self, node, args): |
|
|
|