summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-06-15 23:01:21 +0300
committerGitHub <noreply@github.com>2020-06-15 23:01:21 +0300
commitd526649ee67237a1bedad8228f1f017035ddad3f (patch)
tree9add66943fb765d522601d3c28cceb1ee0bda3d0
parentb15b476371481202504c509a742ca7b453aec8ba (diff)
downloadalacritty-d526649ee67237a1bedad8228f1f017035ddad3f.tar.gz
alacritty-d526649ee67237a1bedad8228f1f017035ddad3f.zip
Use compile_error! instead of panic! in build.rs
The compile_error! failure is way more readable and noticeable than panic!.
-rw-r--r--alacritty/build.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/alacritty/build.rs b/alacritty/build.rs
index b2ee8b6e..05e7bb2d 100644
--- a/alacritty/build.rs
+++ b/alacritty/build.rs
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#[cfg(not(any(feature = "x11", feature = "wayland", target_os = "macos", windows)))]
+compile_error!(r#"at least one of the "x11"/"wayland" features must be enabled"#);
+
use gl_generator::{Api, Fallbacks, GlobalGenerator, Profile, Registry};
use std::env;
@@ -22,10 +25,6 @@ use std::path::Path;
use embed_resource;
fn main() {
- if cfg!(not(any(feature = "x11", feature = "wayland", target_os = "macos", windows))) {
- panic!("at least one of the \"x11\"/\"wayland\" features must be enabled");
- }
-
let hash = rustc_tools_util::get_commit_hash().unwrap_or_default();
println!("cargo:rustc-env=GIT_HASH={}", hash);