modules: move gnome targets into gnome module

They're not used outside of the gnome module anyway, and they create
some annoying potentials for dependency loops
pull/10453/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent d553748b60
commit a2def550c5
  1. 3
      mesonbuild/backend/ninjabackend.py
  2. 18
      mesonbuild/modules/__init__.py
  3. 16
      mesonbuild/modules/gnome.py

@ -29,6 +29,7 @@ import typing as T
from . import backends
from .. import modules
from ..modules import gnome
from .. import environment, mesonlib
from .. import build
from .. import mlog
@ -1558,7 +1559,7 @@ class NinjaBackend(backends.Backend):
target.install_dir[3] = os.path.join(self.environment.get_datadir(), 'gir-1.0')
# Detect gresources and add --gresources arguments for each
for gensrc in other_src[1].values():
if isinstance(gensrc, modules.GResourceTarget):
if isinstance(gensrc, gnome.GResourceTarget):
gres_xml, = self.get_custom_target_sources(gensrc)
args += ['--gresources=' + gres_xml]
extra_args = []

@ -14,9 +14,10 @@
# This file contains the base representation for import('modname')
from __future__ import annotations
import typing as T
from .. import build, mesonlib
from .. import mesonlib
from ..mesonlib import relpath, HoldableObject, MachineChoice
from ..interpreterbase.decorators import noKwargs, noPosargs
@ -189,18 +190,3 @@ class ModuleReturnValue:
self.return_value = return_value
assert isinstance(new_objects, list)
self.new_objects: T.List[T.Union['TYPE_var', 'build.ExecutableSerialisation']] = new_objects
class GResourceTarget(build.CustomTarget):
pass
class GResourceHeaderTarget(build.CustomTarget):
pass
class GirTarget(build.CustomTarget):
pass
class TypelibTarget(build.CustomTarget):
pass
class VapiTarget(build.CustomTarget):
pass

@ -25,7 +25,6 @@ import textwrap
import typing as T
from . import ExtensionModule
from . import GResourceTarget, GResourceHeaderTarget, GirTarget, TypelibTarget, VapiTarget
from . import ModuleReturnValue
from .. import build
from .. import interpreter
@ -247,6 +246,21 @@ def annotations_validator(annotations: T.List[T.Union[str, T.List[str]]]) -> T.O
return f'element {c+1} {badlist}'
return None
class GResourceTarget(build.CustomTarget):
pass
class GResourceHeaderTarget(build.CustomTarget):
pass
class GirTarget(build.CustomTarget):
pass
class TypelibTarget(build.CustomTarget):
pass
class VapiTarget(build.CustomTarget):
pass
# gresource compilation is broken due to the way
# the resource compiler and Ninja clash about it
#

Loading…
Cancel
Save