Skip to content

Commit

Permalink
build: use the block dependencies mechanism for Windows-specific blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mbouron committed Dec 19, 2023
1 parent 4966312 commit 093aa55
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,12 @@ def _glslang_install(cfg):
return cmds


@_block("nopemd-setup")
@_block(
"nopemd-setup",
{
"Windows": [_ffmpeg_install, _sdl2_install],
},
)
def _nopemd_setup(cfg):
builddir = op.join("external", "nopemd", "builddir")
return ["$(MESON_SETUP) -Drpath=true " + _cmd_join(cfg.externals["nopemd"], builddir)]
Expand All @@ -389,7 +394,7 @@ def _renderdoc_install(cfg):
return [f"copy {renderdoc_dll} {cfg.bin_path}"]


@_block("freetype-setup", [_pkgconf_install])
@_block("freetype-setup", {"Windows": [_pkgconf_install]})
def _freetype_setup(cfg):
builddir = op.join("external", "freetype", "builddir")
return ["$(MESON_SETUP) " + _cmd_join(cfg.externals["freetype"], builddir)]
Expand All @@ -411,7 +416,7 @@ def _harfbuzz_install(cfg):
return _meson_compile_install_cmd(cfg, "harfbuzz", external=True)


@_block("fribidi-setup", [_pkgconf_install])
@_block("fribidi-setup", {"Windows": [_pkgconf_install]})
def _fribidi_setup(cfg):
builddir = op.join("external", "fribidi", "builddir")
return ["$(MESON_SETUP) " + _cmd_join("-Ddocs=false", cfg.externals["fribidi"], builddir)]
Expand All @@ -422,7 +427,14 @@ def _fribidi_install(cfg):
return _meson_compile_install_cmd(cfg, "fribidi", external=True)


@_block("nopegl-setup", [_nopemd_install])
@_block(
"nopegl-setup",
{
"Linux": [_nopemd_install],
"Darwin": [_nopemd_install],
"Windows": [_nopemd_install, _sdl2_install, _glslang_install, _harfbuzz_install, _fribidi_install],
},
)
def _nopegl_setup(cfg):
nopegl_opts = []
if cfg.args.debug_opts:
Expand Down Expand Up @@ -541,7 +553,13 @@ def _nopegl_updateglwrappers(cfg):
return _nopegl_run_target_cmd(cfg, "updateglwrappers")


@_block("all", [_ngl_tools_install, _pynopegl_utils_install])
@_block(
"all",
{
"Desktop": [_ngl_tools_install, _pynopegl_utils_install],
"Mobile": [_nopegl_install],
},
)
def _all(cfg):
echo = ["", "Build completed.", "", "You can now enter the venv with:"]
if _SYSTEM == "Windows":
Expand Down Expand Up @@ -793,15 +811,6 @@ def __init__(self, args, externals):
self.externals = externals

if _SYSTEM == "Windows":
_nopemd_setup.prerequisites.append(_pkgconf_install)
_nopemd_setup.prerequisites.append(_egl_registry_install)
_nopemd_setup.prerequisites.append(_opengl_registry_install)
_nopemd_setup.prerequisites.append(_ffmpeg_install)
_nopemd_setup.prerequisites.append(_sdl2_install)
_nopegl_setup.prerequisites.append(_glslang_install)
_nopegl_setup.prerequisites.append(_freetype_install)
_nopegl_setup.prerequisites.append(_harfbuzz_install)
_nopegl_setup.prerequisites.append(_fribidi_install)
if "gpu_capture" in args.debug_opts:
_add_prerequisite(self, _nopegl_setup, _renderdoc_install)

Expand Down

0 comments on commit 093aa55

Please sign in to comment.