File tree 5 files changed +12
-13
lines changed
5 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ impl CxxQtBuilder {
400
400
401
401
let mut qtbuild = qt_build_utils:: QtBuild :: new ( self . qt_modules . into_iter ( ) . collect ( ) )
402
402
. expect ( "Could not find Qt installation" ) ;
403
- qtbuild. cargo_link_libraries ( Some ( & mut self . cc_builder ) ) ;
403
+ qtbuild. cargo_link_libraries ( & mut self . cc_builder ) ;
404
404
405
405
// Write cxx-qt-lib and cxx headers
406
406
cxx_qt_lib_headers:: write_headers ( format ! ( "{header_root}/cxx-qt-lib" ) ) ;
Original file line number Diff line number Diff line change @@ -39,3 +39,4 @@ qt_gui = ["cxx-qt-lib-headers/qt_gui"]
39
39
qt_qml = [" cxx-qt-lib-headers/qt_qml" ]
40
40
time = [" dep:time" ]
41
41
url = [" dep:url" ]
42
+ link_qt_object_files = [" qt-build-utils/link_qt_object_files" ]
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ fn main() {
16
16
}
17
17
18
18
let qtbuild = qt_build_utils:: QtBuild :: new ( qt_modules) . expect ( "Could not find Qt installation" ) ;
19
- qtbuild . cargo_link_libraries ( None ) ;
19
+
20
20
// Required for tests
21
21
qt_build_utils:: setup_linker ( ) ;
22
22
@@ -182,6 +182,8 @@ fn main() {
182
182
let mut builder =
183
183
cxx_build:: bridges ( rust_bridges. iter ( ) . map ( |bridge| format ! ( "src/{bridge}.rs" ) ) ) ;
184
184
185
+ qtbuild. cargo_link_libraries ( & mut builder) ;
186
+
185
187
let mut cpp_files = vec ! [
186
188
"core/qbytearray" ,
187
189
"core/qcoreapplication" ,
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ impl QtBuild {
313
313
lib_path : & str ,
314
314
link_lib : & str ,
315
315
prl_path : & str ,
316
- builder : & mut Option < & mut cc:: Build > ,
316
+ builder : & mut cc:: Build ,
317
317
) {
318
318
println ! ( "cargo:rustc-link-lib={link_lib}" ) ;
319
319
@@ -376,7 +376,7 @@ impl QtBuild {
376
376
}
377
377
378
378
/// Tell Cargo to link each Qt module.
379
- pub fn cargo_link_libraries ( & self , mut builder : Option < & mut cc:: Build > ) {
379
+ pub fn cargo_link_libraries ( & self , builder : & mut cc:: Build ) {
380
380
let prefix_path = self . qmake_query ( "QT_INSTALL_PREFIX" ) ;
381
381
let lib_path = self . qmake_query ( "QT_INSTALL_LIBS" ) ;
382
382
println ! ( "cargo:rustc-link-search={lib_path}" ) ;
@@ -423,7 +423,7 @@ impl QtBuild {
423
423
& lib_path,
424
424
& link_lib,
425
425
& prl_path,
426
- & mut builder,
426
+ builder,
427
427
) ;
428
428
}
429
429
@@ -440,7 +440,7 @@ impl QtBuild {
440
440
& lib_path,
441
441
"qwasm" ,
442
442
& format ! ( "{platforms_path}/libqwasm.prl" ) ,
443
- & mut builder,
443
+ builder,
444
444
) ;
445
445
}
446
446
}
Original file line number Diff line number Diff line change @@ -109,11 +109,7 @@ fn split_flags(link_args: &[u8]) -> Vec<String> {
109
109
words
110
110
}
111
111
112
- pub ( crate ) fn parse_libs_cflags (
113
- name : & str ,
114
- link_args : & [ u8 ] ,
115
- _builder : & mut Option < & mut cc:: Build > ,
116
- ) {
112
+ pub ( crate ) fn parse_libs_cflags ( name : & str , link_args : & [ u8 ] , _builder : & mut cc:: Build ) {
117
113
let mut is_msvc = false ;
118
114
let target = env:: var ( "TARGET" ) ;
119
115
if let Ok ( target) = & target {
@@ -178,7 +174,7 @@ pub(crate) fn parse_libs_cflags(
178
174
let file_name = file_name. to_string_lossy ( ) ;
179
175
if file_name. ends_with ( ".o" ) {
180
176
#[ cfg( feature = "link_qt_object_files" ) ]
181
- if let Some ( builder ) = _builder {
177
+ {
182
178
let path_string = path. to_string_lossy ( ) . to_string ( ) ;
183
179
unsafe {
184
180
// Linking will fail with duplicate symbol errors if the same .o file is linked twice.
@@ -192,7 +188,7 @@ pub(crate) fn parse_libs_cflags(
192
188
// https://github.com/rust-lang/rust/issues/99427#issuecomment-1562092085
193
189
// TODO: remove builder argument when it's not used anymore to link object files.
194
190
// also remove the dependency on cc when this is done
195
- builder . object ( path) ;
191
+ _builder . object ( path) ;
196
192
}
197
193
LINKED_OBJECT_FILES . get_mut ( ) . unwrap ( ) . insert ( path_string) ;
198
194
}
You can’t perform that action at this time.
0 commit comments