@@ -1244,6 +1244,8 @@ def process_kwargs(self, kwargs):
1244
1244
raise InvalidArguments (f'Invalid rust_crate_type "{ rust_crate_type } ": must be a string.' )
1245
1245
if self .rust_crate_type == 'proc-macro' :
1246
1246
FeatureNew .single_use ('Rust crate type "proc-macro"' , '0.62.0' , self .subproject )
1247
+ if self .rust_crate_type == 'clib' :
1248
+ FeatureNew .single_use ('Rust crate type "clib"' , '1.2.0' , self .subproject )
1247
1249
1248
1250
rust_dependency_map = kwargs .get ('rust_dependency_map' , {})
1249
1251
if not isinstance (rust_dependency_map , dict ):
@@ -2001,6 +2003,8 @@ def post_init(self) -> None:
2001
2003
if self .rust_crate_type == 'lib' :
2002
2004
mlog .debug ('Defaulting Rust static library target crate type to rlib' )
2003
2005
self .rust_crate_type = 'rlib'
2006
+ elif self .rust_crate_type == 'clib' :
2007
+ self .rust_crate_type = 'staticlib'
2004
2008
# Don't let configuration proceed with a non-static crate type
2005
2009
elif self .rust_crate_type not in {'rlib' , 'staticlib' }:
2006
2010
raise InvalidArguments (f'Crate type "{ self .rust_crate_type } " invalid for static libraries; must be "rlib" or "staticlib"' )
@@ -2086,6 +2090,8 @@ def post_init(self) -> None:
2086
2090
if self .rust_crate_type == 'lib' :
2087
2091
mlog .debug ('Defaulting Rust dynamic library target crate type to "dylib"' )
2088
2092
self .rust_crate_type = 'dylib'
2093
+ elif self .rust_crate_type == 'clib' :
2094
+ self .rust_crate_type = 'cdylib'
2089
2095
# Don't let configuration proceed with a non-dynamic crate type
2090
2096
elif self .rust_crate_type not in {'dylib' , 'cdylib' , 'proc-macro' }:
2091
2097
raise InvalidArguments (f'Crate type "{ self .rust_crate_type } " invalid for dynamic libraries; must be "dylib", "cdylib", or "proc-macro"' )
0 commit comments