Skip to content

Commit

Permalink
Updated build option error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 30, 2024
1 parent c388ad0 commit 1d15ce8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,29 +393,32 @@ def finalize_options(self) -> None:
self.feature.required.discard(x)
_dbg("Disabling %s", x)
if getattr(self, f"enable_{x}"):
msg = f"Conflicting options: --enable-{x} and --disable-{x}"
msg = f"Conflicting options: '-C {x}=enable' and '-C {x}=disable'"
raise ValueError(msg)
if x == "freetype":
_dbg("--disable-freetype implies --disable-raqm")
_dbg("'-C freetype=disable' implies '-C raqm=disable'")
if getattr(self, "enable_raqm"):
msg = (
"Conflicting options: --enable-raqm and --disable-freetype"
"Conflicting options: "
"'-C raqm=enable' and '-C freetype=disable'"
)
raise ValueError(msg)
setattr(self, "disable_raqm", True)
if getattr(self, f"enable_{x}"):
_dbg("Requiring %s", x)
self.feature.required.add(x)
if x == "raqm":
_dbg("--enable-raqm implies --enable-freetype")
_dbg("'-C raqm=enable' implies '-C freetype=enable'")
self.feature.required.add("freetype")
for x in ("raqm", "fribidi"):
if getattr(self, f"vendor_{x}"):
if getattr(self, "disable_raqm"):
msg = f"Conflicting options: --vendor-{x} and --disable-raqm"
msg = f"Conflicting options: '-C {x}=vendor' and '-C raqm=disable'"
raise ValueError(msg)
if x == "fribidi" and not getattr(self, "vendor_raqm"):
msg = f"Conflicting options: --vendor-{x} and not --vendor-raqm"
msg = (
f"Conflicting options: '-C {x}=vendor' and not '-C raqm=vendor'"
)
raise ValueError(msg)
_dbg("Using vendored version of %s", x)
self.feature.vendor.add(x)
Expand Down Expand Up @@ -1047,7 +1050,7 @@ def debug_build() -> bool:
msg = f"""
The headers or library files could not be found for {str(err)},
which was requested by the option flag --enable-{str(err)}
which was requested by the option flag '-C {str(err)}=enable'
"""
sys.stderr.write(msg)
Expand Down

0 comments on commit 1d15ce8

Please sign in to comment.