Skip to content

Commit 1d15ce8

Browse files
committed
Updated build option error messages
1 parent c388ad0 commit 1d15ce8

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

setup.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,29 +393,32 @@ def finalize_options(self) -> None:
393393
self.feature.required.discard(x)
394394
_dbg("Disabling %s", x)
395395
if getattr(self, f"enable_{x}"):
396-
msg = f"Conflicting options: --enable-{x} and --disable-{x}"
396+
msg = f"Conflicting options: '-C {x}=enable' and '-C {x}=disable'"
397397
raise ValueError(msg)
398398
if x == "freetype":
399-
_dbg("--disable-freetype implies --disable-raqm")
399+
_dbg("'-C freetype=disable' implies '-C raqm=disable'")
400400
if getattr(self, "enable_raqm"):
401401
msg = (
402-
"Conflicting options: --enable-raqm and --disable-freetype"
402+
"Conflicting options: "
403+
"'-C raqm=enable' and '-C freetype=disable'"
403404
)
404405
raise ValueError(msg)
405406
setattr(self, "disable_raqm", True)
406407
if getattr(self, f"enable_{x}"):
407408
_dbg("Requiring %s", x)
408409
self.feature.required.add(x)
409410
if x == "raqm":
410-
_dbg("--enable-raqm implies --enable-freetype")
411+
_dbg("'-C raqm=enable' implies '-C freetype=enable'")
411412
self.feature.required.add("freetype")
412413
for x in ("raqm", "fribidi"):
413414
if getattr(self, f"vendor_{x}"):
414415
if getattr(self, "disable_raqm"):
415-
msg = f"Conflicting options: --vendor-{x} and --disable-raqm"
416+
msg = f"Conflicting options: '-C {x}=vendor' and '-C raqm=disable'"
416417
raise ValueError(msg)
417418
if x == "fribidi" and not getattr(self, "vendor_raqm"):
418-
msg = f"Conflicting options: --vendor-{x} and not --vendor-raqm"
419+
msg = (
420+
f"Conflicting options: '-C {x}=vendor' and not '-C raqm=vendor'"
421+
)
419422
raise ValueError(msg)
420423
_dbg("Using vendored version of %s", x)
421424
self.feature.vendor.add(x)
@@ -1047,7 +1050,7 @@ def debug_build() -> bool:
10471050
msg = f"""
10481051
10491052
The headers or library files could not be found for {str(err)},
1050-
which was requested by the option flag --enable-{str(err)}
1053+
which was requested by the option flag '-C {str(err)}=enable'
10511054
10521055
"""
10531056
sys.stderr.write(msg)

0 commit comments

Comments
 (0)