Revert "modules: move gnome targets into gnome module"

This reverts commit a2def550c5.

This results in a 2k line file being unconditionally imported at
startup, and transitively loading two more (for a total cost of 2759
lines of code), and it's not clear it was ever needed to begin with...
pull/11907/head
Eli Schwartz 2 years ago
parent a1ef957e34
commit a71846d749
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 3
      mesonbuild/backend/ninjabackend.py
  2. 18
      mesonbuild/modules/__init__.py
  3. 21
      mesonbuild/modules/gnome.py
  4. 5
      test cases/unit/113 empty project/expected_mods.json
  5. 2
      unittests/platformagnostictests.py

@ -30,7 +30,6 @@ import typing as T
from . import backends
from .. import modules
from ..modules import gnome
from .. import environment, mesonlib
from .. import build
from .. import mlog
@ -1687,7 +1686,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, gnome.GResourceTarget):
if isinstance(gensrc, modules.GResourceTarget):
gres_xml, = self.get_custom_target_sources(gensrc)
args += ['--gresources=' + gres_xml]
extra_args = []

@ -18,14 +18,13 @@ from __future__ import annotations
import dataclasses
import typing as T
from .. import mesonlib
from .. import build, mesonlib
from ..build import IncludeDirs
from ..interpreterbase.decorators import noKwargs, noPosargs
from ..mesonlib import relpath, HoldableObject, MachineChoice
from ..programs import ExternalProgram
if T.TYPE_CHECKING:
from .. import build
from ..interpreter import Interpreter
from ..interpreter.interpreterobjects import MachineHolder
from ..interpreterbase import TYPE_var, TYPE_kwargs
@ -261,3 +260,18 @@ 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

@ -24,8 +24,10 @@ import subprocess
import textwrap
import typing as T
from . import ExtensionModule, ModuleInfo
from . import ModuleReturnValue
from . import (
ExtensionModule, GirTarget, GResourceHeaderTarget, GResourceTarget, ModuleInfo,
ModuleReturnValue, TypelibTarget, VapiTarget,
)
from .. import build
from .. import interpreter
from .. import mesonlib
@ -249,21 +251,6 @@ 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
#

@ -188,7 +188,6 @@
"mesonbuild.dependencies",
"mesonbuild.dependencies.base",
"mesonbuild.dependencies.detect",
"mesonbuild.dependencies.pkgconfig",
"mesonbuild.depfile",
"mesonbuild.envconfig",
"mesonbuild.environment",
@ -223,13 +222,11 @@
"mesonbuild.mintro",
"mesonbuild.mlog",
"mesonbuild.modules",
"mesonbuild.modules.gnome",
"mesonbuild.mparser",
"mesonbuild.msetup",
"mesonbuild.optinterpreter",
"mesonbuild.programs",
"mesonbuild.scripts",
"mesonbuild.scripts.gettext",
"mesonbuild.scripts.meson_exe",
"mesonbuild.utils",
"mesonbuild.utils.core",
@ -240,6 +237,6 @@
"mesonbuild.wrap",
"mesonbuild.wrap.wrap"
],
"count": 71
"count": 68
}
}

@ -253,4 +253,4 @@ class PlatformAgnosticTests(BasePlatformTests):
expected = json.load(f)['meson']['modules']
self.assertEqual(data['modules'], expected)
self.assertEqual(data['count'], 71)
self.assertEqual(data['count'], 68)

Loading…
Cancel
Save