3
3
//
4
4
// SPDX-License-Identifier: MIT OR Apache-2.0
5
5
6
+ #![ deny( missing_docs) ]
7
+
6
8
//! This crate provides information about the Qt installation and can invoke Qt's
7
9
//! [moc](https://doc.qt.io/qt-6/moc.html) code generator. This crate does not build
8
10
//! any C++ code on its own. It is intended to be used in [build.rs scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html)
@@ -28,11 +30,14 @@ pub use versions::SemVer;
28
30
use thiserror:: Error ;
29
31
30
32
#[ derive( Error , Debug ) ]
33
+ /// Errors that can occur while using [QtBuild]
31
34
pub enum QtBuildError {
32
35
/// `QMAKE` environment variable was set but Qt was not detected
33
36
#[ error( "QMAKE environment variable specified as {qmake_env_var} but could not detect Qt: {error:?}" ) ]
34
37
QMakeSetQtMissing {
38
+ /// The value of the qmake environment variable when the error occurred
35
39
qmake_env_var : String ,
40
+ /// The inner [QtBuildError] that occurred
36
41
error : Box < QtBuildError > ,
37
42
} ,
38
43
/// Qt was not found
@@ -44,13 +49,17 @@ pub enum QtBuildError {
44
49
/// `QT_VERSION_MAJOR` environment variable was specified but could not be parsed as an integer
45
50
#[ error( "QT_VERSION_MAJOR environment variable specified as {qt_version_major_env_var} but could not parse as integer: {source:?}" ) ]
46
51
QtVersionMajorInvalid {
52
+ /// The Qt major version from `QT_VERSION_MAJOR`
47
53
qt_version_major_env_var : String ,
54
+ /// The [std::num::ParseIntError] when parsing the `QT_VERSION_MAJOR`
48
55
source : std:: num:: ParseIntError ,
49
56
} ,
50
57
/// `QT_VERSION_MAJOR` environment variable was specified but the Qt version specified by `qmake -query QT_VERSION` did not match
51
58
#[ error( "qmake version ({qmake_version}) does not match version specified by QT_VERSION_MAJOR ({qt_version_major})" ) ]
52
59
QtVersionMajorDoesNotMatch {
60
+ /// The qmake version
53
61
qmake_version : u32 ,
62
+ /// The Qt major version from `QT_VERSION_MAJOR`
54
63
qt_version_major : u32 ,
55
64
} ,
56
65
}
0 commit comments