poppler: refuse to build with incompatible options

Previously, if both `--with-qt` and `--with-qt5` were passed, the latter
was silently ignored. This sometimes caused confusion because the Qt 5
bindings were missing. The build now aborts in such cases and prints a
helpful error message.

Closes Homebrew/homebrew#44954.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Martin Afanasjew 2015-10-14 18:39:00 +02:00 committed by Xu Cheng
parent 379ef0e677
commit b92eea9be0

View file

@ -52,7 +52,9 @@ class Poppler < Formula
--enable-introspection=yes
]
if build.with? "qt"
if build.with?("qt") && build.with?("qt5")
raise "poppler: --with-qt and --with-qt5 cannot be used at the same time"
elsif build.with? "qt"
args << "--enable-poppler-qt4"
elsif build.with? "qt5"
args << "--enable-poppler-qt5"