File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,13 @@ fn qmake_query(var: &str) -> Result<String, std::io::Error> {
31
31
32
32
// qreal is a double, unless QT_COORD_TYPE says otherwise:
33
33
// https://doc.qt.io/qt-5/qtglobal.html#qreal-typedef
34
- fn detect_qreal_size ( qt_include_path : & str ) {
35
- let path = Path :: new ( qt_include_path) . join ( "QtCore" ) . join ( "qconfig.h" ) ;
34
+ fn detect_qreal_size ( qt_include_path : & str , qt_library_path : & str ) {
35
+ let mut path = Path :: new ( qt_include_path) . join ( "QtCore/qconfig.h" ) ;
36
+ if cfg ! ( target_os = "macos" ) {
37
+ if !path. exists ( ) {
38
+ path = Path :: new ( qt_library_path) . join ( "QtCore.framework/Headers/qconfig.h" ) ;
39
+ }
40
+ }
36
41
let f = std:: fs:: File :: open ( & path) . expect ( & format ! ( "Cannot open `{:?}`" , path) ) ;
37
42
let b = BufReader :: new ( f) ;
38
43
@@ -77,7 +82,7 @@ fn main() {
77
82
config. flag ( qt_library_path. trim ( ) ) ;
78
83
}
79
84
80
- detect_qreal_size ( & qt_include_path. trim ( ) ) ;
85
+ detect_qreal_size ( & qt_include_path. trim ( ) , qt_library_path . trim ( ) ) ;
81
86
82
87
config. include ( qt_include_path. trim ( ) ) . build ( "src/lib.rs" ) ;
83
88
You can’t perform that action at this time.
0 commit comments