aboutsummaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'build.py')
-rw-r--r--build.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/build.py b/build.py
index e838b67..8b372f3 100644
--- a/build.py
+++ b/build.py
@@ -124,11 +124,15 @@ class Build:
return self.global_args.get(compiler.get_language(), [])
class IncludeDirs():
- def __init__(self, curdir, dirs):
+ def __init__(self, curdir, dirs, extra_build_dirs=None):
self.curdir = curdir
self.incdirs = dirs
# Interpreter has validated that all given directories
# actually exist.
+ if extra_build_dirs is None:
+ self.extra_build_dirs = []
+ else:
+ self.extra_build_dirs = extra_build_dirs
def get_curdir(self):
return self.curdir
@@ -136,6 +140,9 @@ class IncludeDirs():
def get_incdirs(self):
return self.incdirs
+ def get_extra_build_dirs(self):
+ return self.extra_build_dirs
+
class ExtractedObjects():
def __init__(self, target, srclist):
self.target = target
@@ -545,7 +552,7 @@ class Generator():
if not isinstance(rule, str):
raise InvalidArguments('"output" may only contain strings.')
if not '@BASENAME@' in rule and not '@PLAINNAME@' in rule:
- raise InvalidArguments('"outputs" must contain @BASENAME@ or @PLAINNAME@.')
+ raise InvalidArguments('Every element of "output" must contain @BASENAME@ or @PLAINNAME@.')
if '/' in rule or '\\' in rule:
raise InvalidArguments('"outputs" must not contain a directory separator.')
if len(outputs) > 1:
@@ -613,6 +620,8 @@ class StaticLibrary(BuildTarget):
raise InvalidArguments('Static libraries not supported for C#.')
self.prefix = environment.get_static_lib_prefix()
self.suffix = environment.get_static_lib_suffix()
+ if len(self.sources) > 0 and self.sources[0].endswith('.rs'):
+ self.suffix = 'rlib'
self.filename = self.prefix + self.name + '.' + self.suffix
def get_import_filename(self):
@@ -635,6 +644,8 @@ class SharedLibrary(BuildTarget):
else:
self.prefix = environment.get_shared_lib_prefix()
self.suffix = environment.get_shared_lib_suffix()
+ if len(self.sources) > 0 and self.sources[0].endswith('.rs'):
+ self.suffix = 'rlib'
self.importsuffix = environment.get_import_lib_suffix()
self.filename = self.prefix + self.name + '.' + self.suffix