1use cmake::Config;
2use std::env;
3use std::path::Path;
4
5pub fn build() {
6 let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("submodules/libjxl");
7 let mut config = Config::new(path);
8 config.define("JPEGXL_ENABLE_OPENEXR", "OFF");
9 config.define("JPEGXL_ENABLE_BENCHMARK", "OFF");
10
11 let target = env::var("TARGET").unwrap();
12 if target.contains("msvc") {
13 config
14 .define("CMAKE_C_COMPILER", "clang-cl")
16 .define("CMAKE_CXX_COMPILER", "clang-cl")
17 .generator("Ninja");
19 }
20
21 config
22 .define("JPEGXL_STATIC", "ON")
23 .define("BUILD_TESTING", "OFF")
24 .define("JPEGXL_ENABLE_EXAMPLES", "OFF")
25 .define("JPEGXL_ENABLE_TOOLS", "OFF")
26 .build();
27}