Correctly set the include dirs for mixed_target.
Until now, mixed targets was only about native build and so we were not using a meson cross_config file and env var was enough. But now we also to correctly set it in the cross_config file.
This commit is contained in:
parent
b218875d49
commit
260b93a51d
|
@ -45,7 +45,7 @@ class AndroidPlatformInfo(PlatformInfo):
|
|||
|
||||
def get_cross_config(self):
|
||||
extra_libs = ['-llog']
|
||||
extra_cflags = ['-I{}'.format(pj(self.buildEnv.install_dir, 'include'))]
|
||||
extra_cflags = ['-I{}'.format(include_dir) for include_dir in self.get_include_dirs()]
|
||||
if hasattr(self, 'march'):
|
||||
extra_libs.append('-march={}'.format(self.march))
|
||||
extra_cflags.append('-march={}'.format(self.march))
|
||||
|
|
|
@ -16,7 +16,7 @@ class ArmhfPlatformInfo(PlatformInfo):
|
|||
'exe_wrapper_def': '',
|
||||
'root_path': self.root_path,
|
||||
'extra_libs': [],
|
||||
'extra_cflags': ['-I{}'.format(pj(self.buildEnv.install_dir, 'include'))],
|
||||
'extra_cflags': ['-I{}'.format(include_dir) for include_dir in self.get_include_dirs()],
|
||||
'host_machine': {
|
||||
'system': 'linux',
|
||||
'lsystem': 'linux',
|
||||
|
|
|
@ -77,6 +77,8 @@ class PlatformInfo(metaclass=_MetaPlatform):
|
|||
def get_cross_config(self):
|
||||
return {}
|
||||
|
||||
def get_include_dirs(self):
|
||||
return [pj(self.buildEnv.install_dir, 'include')]
|
||||
|
||||
def get_env(self):
|
||||
return DefaultEnv()
|
||||
|
@ -151,16 +153,23 @@ def MixedMixin(static_name):
|
|||
return self.name, dep
|
||||
return static_name, dep
|
||||
|
||||
@property
|
||||
def static_buildEnv(self):
|
||||
static_platform = self.get_platform(static_name)
|
||||
return static_platform.buildEnv
|
||||
|
||||
def get_include_dirs(self):
|
||||
return [
|
||||
pj(self.buildEnv.install_dir, 'include'),
|
||||
pj(self.static_buildEnv.install_dir, 'include')
|
||||
]
|
||||
|
||||
def get_env(self):
|
||||
env = super().get_env()
|
||||
static_platform = self.get_platform(static_name)
|
||||
static_buildEnv = static_platform.buildEnv
|
||||
static_install_dir = static_buildEnv.install_dir
|
||||
env['PATH'] = ':'.join([pj(static_install_dir, 'bin')] + [env['PATH']])
|
||||
pkgconfig_path = pj(static_install_dir, static_buildEnv.libprefix, 'pkgconfig')
|
||||
env['PATH'] = ':'.join([pj(self.static_buildEnv.install_dir, 'bin')] + [env['PATH']])
|
||||
pkgconfig_path = pj(self.static_buildEnv.install_dir, self.static_buildEnv.libprefix, 'pkgconfig')
|
||||
env['PKG_CONFIG_PATH'] = ':'.join([env['PKG_CONFIG_PATH'], pkgconfig_path])
|
||||
env['CPPFLAGS'] = " ".join(['-I'+pj(static_install_dir, 'include'), env['CPPFLAGS']])
|
||||
env['CPPFLAGS'] = " ".join(['-I'+pj(self.static_buildEnv.install_dir, 'include'), env['CPPFLAGS']])
|
||||
return env
|
||||
|
||||
return MixedMixinClass
|
||||
|
|
|
@ -14,7 +14,12 @@ class I586PlatformInfo(PlatformInfo):
|
|||
'binaries': self.binaries,
|
||||
'exe_wrapper_def': '',
|
||||
'extra_libs': ['-m32', '-march=i586', '-mno-sse'],
|
||||
'extra_cflags': ['-m32', '-march=i586', '-mno-sse', '-I{}'.format(pj(self.buildEnv.install_dir, 'include'))],
|
||||
'extra_cflags': [
|
||||
'-m32',
|
||||
'-march=i586',
|
||||
'-mno-sse',
|
||||
*('-I{}'.format(include_dir) for include_dir in self.get_include_dirs())
|
||||
],
|
||||
'host_machine': {
|
||||
'system': 'linux',
|
||||
'lsystem': 'linux',
|
||||
|
|
|
@ -52,7 +52,7 @@ class ApplePlatformInfo(PlatformInfo):
|
|||
'-arch', self.arch,
|
||||
'-target', self.target,
|
||||
'-stdlib=libc++',
|
||||
'-I{}'.format(pj(self.buildEnv.install_dir, 'include'))
|
||||
*('-I{}'.format(include_dir) for include_dir in self.get_include_dirs())
|
||||
],
|
||||
'host_machine': {
|
||||
'system': 'Darwin',
|
||||
|
|
|
@ -17,7 +17,7 @@ class Win32PlatformInfo(PlatformInfo):
|
|||
'binaries': self.binaries,
|
||||
'root_path': self.root_path,
|
||||
'extra_libs': self.extra_libs,
|
||||
'extra_cflags': ['-DWIN32', '-I{}'.format(pj(self.buildEnv.install_dir, 'include'))],
|
||||
'extra_cflags': ['-DWIN32', *('-I{}'.format(include_dir) for include_dir in self.get_include_dirs())],
|
||||
'host_machine': {
|
||||
'system': 'Windows',
|
||||
'lsystem': 'windows',
|
||||
|
|
Loading…
Reference in New Issue