aedi: use pathlib for compilers and sdk paths

This commit is contained in:
alexey.lysiuk 2021-08-05 10:02:55 +03:00
parent 2a64d4c12d
commit 419a8d746c
4 changed files with 11 additions and 11 deletions

View file

@ -66,14 +66,14 @@ class BuildState:
def os_version(self) -> StrictVersion:
return self.platform.os_version if self.platform else None
def sdk_path(self) -> str:
return self.platform.sdk_path if self.platform else ''
def sdk_path(self) -> Path:
return self.platform.sdk_path if self.platform else Path()
def c_compiler(self) -> str:
return self.platform.c_compiler if self.platform else ''
def c_compiler(self) -> Path:
return self.platform.c_compiler if self.platform else Path()
def cxx_compiler(self) -> str:
return self.platform.cxx_compiler if self.platform else ''
def cxx_compiler(self) -> Path:
return self.platform.cxx_compiler if self.platform else Path()
def checkout_git(self, url: str, branch: str = None):
if self.source.exists():

View file

@ -94,8 +94,8 @@ class BuildTarget(Target):
if state.xcode:
return
env['CC'] = state.c_compiler()
env['CXX'] = state.cxx_compiler()
env['CC'] = str(state.c_compiler())
env['CXX'] = str(state.cxx_compiler())
for prefix in ('CPP', 'C', 'CXX', 'OBJC', 'OBJCXX'):
var_name = f'{prefix}FLAGS'

View file

@ -219,7 +219,7 @@ class ZipTarget(MakeTarget):
def build(self, state: BuildState):
args = [
state.c_compiler(),
str(state.c_compiler()),
'-O3', '-I.', '-DUNIX',
'-DBZIP2_SUPPORT', '-DLARGE_FILE_SUPPORT', '-DUNICODE_SUPPORT',
'-DHAVE_DIRENT_H', '-DHAVE_TERMIOS_H',

View file

@ -58,8 +58,8 @@ class TargetPlatform:
self.host = host
self.os_version = os_version if isinstance(os_version, StrictVersion) else StrictVersion(os_version)
self.sdk_path = sdk_path
self.c_compiler = prefix_path / 'bin' / f'{host}-gcc'
self.cxx_compiler = prefix_path / 'bin' / f'{host}-g++'
self.c_compiler = prefix_path / f'bin/{host}-gcc'
self.cxx_compiler = prefix_path / f'bin/{host}-g++'
def symlink_directory(src_path: Path, dst_path: Path, cleanup=True):