--- a/build.rs
+++ b/build.rs
@@ -18,8 +18,6 @@
 //! Build script for jpegxl-sys.
 
 fn main() {
-    #[cfg(all(not(feature = "vendored"), not(feature = "docs")))]
-    {
         use std::env;
         let version = env!("CARGO_PKG_VERSION")
             .split('+')
@@ -27,11 +25,6 @@ fn main() {
             .and_then(|s| s.split('-').nth(1))
             .unwrap();
 
-        if let Ok(path) = env::var("DEP_JXL_LIB") {
-            println!("cargo:rustc-link-search=native={path}");
-            println!("cargo:rustc-link-lib=jxl");
-            println!("cargo:rustc-link-lib=jxl_threads");
-        } else {
             pkg_config::Config::new()
                 .atleast_version(version)
                 .probe("libjxl")
@@ -42,9 +35,4 @@ fn main() {
                 .unwrap_or_else(|_| {
                     panic!("Cannot find `libjxl_threads` with version >= {version}")
                 });
-        }
-    }
-
-    #[cfg(feature = "vendored")]
-    jpegxl_src::build();
 }
