mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00

This requires some gymnastics to get right as the information need to be passed to the compiler despite having no direct dependency between the compiler and the runtime or backends. So use a file in the build directory to tell the default style cc: #83
21 lines
945 B
Rust
21 lines
945 B
Rust
/* LICENSE BEGIN
|
|
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
|
Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
|
Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
|
|
|
SPDX-License-Identifier: GPL-3.0-only
|
|
This file is also available under commercial licensing terms.
|
|
Please contact info@sixtyfps.io for more information.
|
|
LICENSE END */
|
|
|
|
use std::path::Path;
|
|
|
|
fn main() {
|
|
// This file is written by the sixtyfps-rendering-backend-default's built script. At this point
|
|
// the build script might not have ran yet, but we just need to pass the path to the build directory
|
|
// to the macro crate itself.
|
|
let out_dir = std::env::var_os("OUT_DIR").unwrap();
|
|
let target_path =
|
|
Path::new(&out_dir).parent().unwrap().parent().unwrap().join("SIXTYFPS_DEFAULT_STYLE.txt");
|
|
println!("cargo:rustc-env=SIXTYFPS_DEFAULT_STYLE_PATH={}", target_path.display());
|
|
}
|