File tree 2 files changed +25
-25
lines changed
crates/qt-build-utils/src
2 files changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,30 @@ impl TryFrom<PathBuf> for QtInstallationQMake {
99
99
}
100
100
101
101
impl QtInstallation for QtInstallationQMake {
102
- fn include_modules ( & self , _qt_modules : & [ String ] ) -> Vec < PathBuf > {
103
- todo ! ( )
102
+ fn include_modules ( & self , qt_modules : & [ String ] ) -> Vec < PathBuf > {
103
+ let root_path = self . qmake_query ( "QT_INSTALL_HEADERS" ) ;
104
+ let lib_path = self . qmake_query ( "QT_INSTALL_LIBS" ) ;
105
+ let mut paths = Vec :: new ( ) ;
106
+ for qt_module in qt_modules {
107
+ // Add the usual location for the Qt module
108
+ paths. push ( format ! ( "{root_path}/Qt{qt_module}" ) ) ;
109
+
110
+ // Ensure that we add any framework's headers path
111
+ let header_path = format ! ( "{lib_path}/Qt{qt_module}.framework/Headers" ) ;
112
+ if utils:: is_apple_target ( ) && Path :: new ( & header_path) . exists ( ) {
113
+ paths. push ( header_path) ;
114
+ }
115
+ }
116
+
117
+ // Add the QT_INSTALL_HEADERS itself
118
+ paths. push ( root_path) ;
119
+
120
+ paths
121
+ . iter ( )
122
+ . map ( PathBuf :: from)
123
+ // Only add paths if they exist
124
+ . filter ( |path| path. exists ( ) )
125
+ . collect ( )
104
126
}
105
127
106
128
fn link_modules ( & self , builder : & mut cc:: Build , qt_modules : & [ String ] ) {
Original file line number Diff line number Diff line change @@ -411,29 +411,7 @@ impl QtBuild {
411
411
/// Get the include paths for Qt, including Qt module subdirectories. This is intended
412
412
/// to be passed to whichever tool you are using to invoke the C++ compiler.
413
413
pub fn include_paths ( & self ) -> Vec < PathBuf > {
414
- let root_path = self . qmake_query ( "QT_INSTALL_HEADERS" ) ;
415
- let lib_path = self . qmake_query ( "QT_INSTALL_LIBS" ) ;
416
- let mut paths = Vec :: new ( ) ;
417
- for qt_module in & self . qt_modules {
418
- // Add the usual location for the Qt module
419
- paths. push ( format ! ( "{root_path}/Qt{qt_module}" ) ) ;
420
-
421
- // Ensure that we add any framework's headers path
422
- let header_path = format ! ( "{lib_path}/Qt{qt_module}.framework/Headers" ) ;
423
- if utils:: is_apple_target ( ) && Path :: new ( & header_path) . exists ( ) {
424
- paths. push ( header_path) ;
425
- }
426
- }
427
-
428
- // Add the QT_INSTALL_HEADERS itself
429
- paths. push ( root_path) ;
430
-
431
- paths
432
- . iter ( )
433
- . map ( PathBuf :: from)
434
- // Only add paths if they exist
435
- . filter ( |path| path. exists ( ) )
436
- . collect ( )
414
+ self . qt_installation . include_modules ( & self . qt_modules )
437
415
}
438
416
439
417
/// Version of the detected Qt installation
You can’t perform that action at this time.
0 commit comments