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 @@ -399,7 +399,7 @@ impl CxxQtBuilder {
399
399
400
400
let mut qtbuild = qt_build_utils:: QtBuild :: new ( self . qt_modules . into_iter ( ) . collect ( ) )
401
401
. expect ( "Could not find Qt installation" ) ;
402
- qtbuild. cargo_link_libraries ( Some ( & mut self . cc_builder ) ) ;
402
+ qtbuild. cargo_link_libraries ( & mut self . cc_builder ) ;
403
403
404
404
// Write cxx-qt-gen, cxx-qt-lib and cxx headers
405
405
cxx_qt_gen:: write_headers ( format ! ( "{header_root}/cxx-qt-common" ) ) ;
Original file line number Diff line number Diff line change @@ -40,3 +40,4 @@ qt_gui = ["cxx-qt-lib-headers/qt_gui"]
40
40
qt_qml = [" cxx-qt-lib-headers/qt_qml" ]
41
41
time = [" dep:time" ]
42
42
url = [" dep:url" ]
43
+ link_qt_object_files = [" qt-build-utils/link_qt_object_files" ]
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ fn main() {
20
20
}
21
21
22
22
let qtbuild = qt_build_utils:: QtBuild :: new ( qt_modules) . expect ( "Could not find Qt installation" ) ;
23
- qtbuild . cargo_link_libraries ( None ) ;
23
+
24
24
// Required for tests
25
25
qt_build_utils:: setup_linker ( ) ;
26
26
@@ -192,6 +192,8 @@ fn main() {
192
192
let mut builder =
193
193
cxx_build:: bridges ( rust_bridges. iter ( ) . map ( |bridge| format ! ( "src/{bridge}.rs" ) ) ) ;
194
194
195
+ qtbuild. cargo_link_libraries ( & mut builder) ;
196
+
195
197
let mut cpp_files = vec ! [
196
198
"core/qbytearray" ,
197
199
"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