Skip to content

Commit 57a2bba

Browse files
jservclaude
andcommitted
Add verbose mode for dependency checking (V=1)
Addresses cubic-dev-ai review feedback about suppressed error messages making dependency issues harder to diagnose. Changes: - Added V=1 flag support to show pkg-config/config-tool errors - Default mode (V=0) remains silent for optional dependencies - Conditional _dep_stderr variable controls stderr redirection Usage: make # Silent mode (original behavior) make V=1 # Verbose mode (shows all dependency errors) Testing: - macOS V=0: No warnings (all dependencies present) - macOS V=1: No errors (all dependencies present) - Lima V=0: Silent (cairo/sdl2 missing, no warnings) - Lima V=1: Shows "Package cairo/sdl2 not found" messages This preserves the original design goal (no warnings for optional dependencies) while providing a debug path for diagnosing real issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2a84ce6 commit 57a2bba

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

mk/deps.mk

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,28 @@
88
# 1. Try package-config tool first (e.g., sdl2-config) - single package only
99
# 2. Fall back to pkg-config if available - supports multiple packages
1010
# 3. Return empty string if package(s) not found
11+
#
12+
# Verbose mode: Set V=1 to show dependency-checking errors
13+
# make V=1 # Show all pkg-config/config-tool errors
14+
# make # Silent mode (default)
15+
16+
# Conditional stderr redirection based on V= flag
17+
ifeq ($(V),1)
18+
_dep_stderr :=
19+
else
20+
_dep_stderr := 2>/dev/null
21+
endif
1122

1223
# Internal: Try package-specific config tool (single package only)
1324
# Usage: $(call _dep-config,package-name,flag-type)
1425
define _dep-config
15-
$(shell command -v $(1)-config >/dev/null 2>&1 && $(1)-config --$(2) 2>/dev/null)
26+
$(shell command -v $(1)-config >/dev/null 2>&1 && $(1)-config --$(2) $(_dep_stderr))
1627
endef
1728

1829
# Internal: Try pkg-config (supports multiple packages)
1930
# Usage: $(call _dep-pkg,package-names,flag-type)
2031
define _dep-pkg
21-
$(shell pkg-config --$(2) $(1) 2>/dev/null)
32+
$(shell pkg-config --$(2) $(1) $(_dep_stderr))
2233
endef
2334

2435
# Internal: Check if input contains multiple packages

0 commit comments

Comments
 (0)