From 43e07320a54e72e69957dfa7f55922f77fd5207e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 28 Jul 2021 15:53:30 +0200 Subject: [PATCH] Fix comments and naming found in review in #355 --- api/sixtyfps-rs/sixtyfps-build/lib.rs | 1 + sixtyfps_runtime/rendering_backends/default/build.rs | 6 +++--- sixtyfps_runtime/rendering_backends/qt/build.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/sixtyfps-rs/sixtyfps-build/lib.rs b/api/sixtyfps-rs/sixtyfps-build/lib.rs index d81c557fc..fb9a56d7f 100644 --- a/api/sixtyfps-rs/sixtyfps-build/lib.rs +++ b/api/sixtyfps-rs/sixtyfps-build/lib.rs @@ -203,6 +203,7 @@ pub fn compile_with_config( }; if std::env::var_os("SIXTYFPS_STYLE").is_none() && compiler_config.style.is_none() { compiler_config.style = std::env::var_os("OUT_DIR").and_then(|path| { + // Same logic as in sixtyfps-rendering-backend-default's build script to get the path let path = Path::new(&path).parent()?.parent()?.join("SIXTYFPS_DEFAULT_STYLE.txt"); let style = std::fs::read_to_string(path).ok()?; Some(style.trim().into()) diff --git a/sixtyfps_runtime/rendering_backends/default/build.rs b/sixtyfps_runtime/rendering_backends/default/build.rs index 4599281fe..b639b3eab 100644 --- a/sixtyfps_runtime/rendering_backends/default/build.rs +++ b/sixtyfps_runtime/rendering_backends/default/build.rs @@ -17,10 +17,10 @@ fn main() { // The way this work is this // 1. `qttypes`' crate's build script already detects Qt and set the DEP_QT_VERSION // 2. The qt rendering backend's build script will check if the qttype crates found Qt and - // look at the SIXTYFPS_NO_QT env variable, and sets the DEP_SIXTYFPS_RENDERING_BACKEND_QT_HAS_NATIVE_STYLE + // look at the SIXTYFPS_NO_QT env variable, and sets the DEP_SIXTYFPS_RENDERING_BACKEND_QT_SUPPORTS_NATIVE_STYLE // env variable so that the default rendering backend can know if Qt was there. // 3. here, in the default rendering backend, we know if we depends on the qt backend and if it - // has set the DEP_SIXTYFPS_RENDERING_BACKEND_QT_HAS_NATIVE_STYLE env variable. + // has set the DEP_SIXTYFPS_RENDERING_BACKEND_QT_SUPPORTS_NATIVE_STYLE env variable. // We then write a file in the build directory with the default style that depends on the // Qt availability // 4a. When using the sixtyfps-build crate from a build script, it will be able to read this file @@ -29,7 +29,7 @@ fn main() { // the location of that file, the build script of sixtyfps-macros had to save the path in an env // variable - let has_native_style = std::env::var("DEP_SIXTYFPS_RENDERING_BACKEND_QT_HAS_NATIVE_STYLE") + let has_native_style = std::env::var("DEP_SIXTYFPS_RENDERING_BACKEND_QT_SUPPORTS_NATIVE_STYLE") .unwrap_or_default() == "1"; diff --git a/sixtyfps_runtime/rendering_backends/qt/build.rs b/sixtyfps_runtime/rendering_backends/qt/build.rs index 700a1f319..38240d6a4 100644 --- a/sixtyfps_runtime/rendering_backends/qt/build.rs +++ b/sixtyfps_runtime/rendering_backends/qt/build.rs @@ -49,5 +49,5 @@ fn main() { println!("cargo:rerun-if-changed=qt_window.rs"); println!("cargo:rerun-if-changed=widgets.rs"); println!("cargo:rerun-if-changed=lib.rs"); - println!("cargo:HAS_NATIVE_STYLE=1"); + println!("cargo:SUPPORTS_NATIVE_STYLE=1"); }