aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2023-04-24 14:47:45 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-04-26 14:51:10 -0400
commitbf44120a4f272652f98c607bd05065e8a0492d3a (patch)
tree73348053c9ec873f4f9f1ad519f63666b69348fa /mesonbuild
parent07bd28732ebe07ed68772590cff5b16813038843 (diff)
downloadmeson-bf44120a4f272652f98c607bd05065e8a0492d3a.zip
meson-bf44120a4f272652f98c607bd05065e8a0492d3a.tar.gz
meson-bf44120a4f272652f98c607bd05065e8a0492d3a.tar.bz2
Set the CC environment variable for g-ir-scanner.
Fixes #1035
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/gnome.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index d749c26..7c7e41d 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -37,7 +37,7 @@ from ..interpreterbase import noPosargs, noKwargs, FeatureNew, FeatureDeprecated
from ..interpreterbase import typed_kwargs, KwargInfo, ContainerTypeInfo
from ..interpreterbase.decorators import typed_pos_args
from ..mesonlib import (
- MachineChoice, MesonException, OrderedSet, Popen_safe, join_args,
+ MachineChoice, MesonException, OrderedSet, Popen_safe, join_args, quote_arg
)
from ..programs import OverrideProgram
from ..scripts.gettext import read_linguas
@@ -979,6 +979,9 @@ class GnomeModule(ExtensionModule):
# settings user could have set in machine file, like PKG_CONFIG_LIBDIR,
# SYSROOT, etc.
run_env = PkgConfigDependency.get_env(state.environment, MachineChoice.HOST, uninstalled=True)
+ # g-ir-scanner uses Python's distutils to find the compiler, which uses 'CC'
+ cc_exelist = state.environment.coredata.compilers.host['c'].get_exelist()
+ run_env.set('CC', [quote_arg(x) for x in cc_exelist], ' ')
return GirTarget(
girfile,