Do not hardcode binary's name in templates.

This may change from on host platform to another. Use the cross_env.
This commit is contained in:
Matthieu Gautier
2017-02-06 17:33:39 +01:00
parent 2451c35d79
commit b205526bb2
4 changed files with 20 additions and 15 deletions

View File

@ -27,6 +27,8 @@ CROSS_ENV = {
'cpp' : 'i686-w64-mingw32-g++',
'ar' : 'i686-w64-mingw32-ar',
'strip' : 'i686-w64-mingw32-strip',
'windres' : 'i686-w64-mingw32-windres',
'ranlib' : 'i686-w64-mingw32-ranlib',
'pkgconfig' : 'i686-w64-mingw32-pkg-config',
'exe_wrapper' : 'wine'
},
@ -101,6 +103,9 @@ class Which():
output = subprocess.check_output(command, shell=True)
return output[:-1].decode()
def __format__(self, format_spec):
return getattr(self, format_spec)
def remove_duplicates(iterable, key_function=None):
seen = set()
if key_function is None:
@ -230,7 +235,7 @@ class BuildEnv:
template = f.read()
content = template.format(
which=Which(),
root_path=self.cross_env['root_path']
**self.cross_env
)
with open(crossfile, 'w') as outfile:
outfile.write(content)