@@ -1968,11 +1968,11 @@ pub struct TargetOptions {
1968
1968
linker_is_gnu_json : bool ,
1969
1969
1970
1970
/// Objects to link before and after all other object code.
1971
- pub pre_link_objects : CrtObjects ,
1972
- pub post_link_objects : CrtObjects ,
1971
+ pub pre_link_objects : MaybeLazy < CrtObjects > ,
1972
+ pub post_link_objects : MaybeLazy < CrtObjects > ,
1973
1973
/// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
1974
- pub pre_link_objects_self_contained : CrtObjects ,
1975
- pub post_link_objects_self_contained : CrtObjects ,
1974
+ pub pre_link_objects_self_contained : MaybeLazy < CrtObjects > ,
1975
+ pub post_link_objects_self_contained : MaybeLazy < CrtObjects > ,
1976
1976
/// Behavior for the self-contained linking mode: inferred for some targets, or explicitly
1977
1977
/// enabled (in bulk, or with individual components).
1978
1978
pub link_self_contained : LinkSelfContainedDefault ,
@@ -2452,10 +2452,10 @@ impl Default for TargetOptions {
2452
2452
static_position_independent_executables : false ,
2453
2453
plt_by_default : true ,
2454
2454
relro_level : RelroLevel :: None ,
2455
- pre_link_objects : Default :: default ( ) ,
2456
- post_link_objects : Default :: default ( ) ,
2457
- pre_link_objects_self_contained : Default :: default ( ) ,
2458
- post_link_objects_self_contained : Default :: default ( ) ,
2455
+ pre_link_objects : MaybeLazy :: lazy ( Default :: default) ,
2456
+ post_link_objects : MaybeLazy :: lazy ( Default :: default) ,
2457
+ pre_link_objects_self_contained : MaybeLazy :: lazy ( Default :: default) ,
2458
+ post_link_objects_self_contained : MaybeLazy :: lazy ( Default :: default) ,
2459
2459
link_self_contained : LinkSelfContainedDefault :: False ,
2460
2460
pre_link_args : MaybeLazy :: lazy ( LinkArgs :: new) ,
2461
2461
pre_link_args_json : LinkArgsCli :: new ( ) ,
@@ -3046,7 +3046,7 @@ impl Target {
3046
3046
3047
3047
args. insert( kind, v) ;
3048
3048
}
3049
- base. $key_name = args;
3049
+ base. $key_name = MaybeLazy :: owned ( args) ;
3050
3050
}
3051
3051
} ) ;
3052
3052
( $key_name: ident = $json_name: expr, link_args) => ( {
0 commit comments