File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,18 @@ pub fn export_bool_kconfig() {
33
33
println ! ( "cargo:rerun-if-env-changed=DOTCONFIG" ) ;
34
34
println ! ( "cargo-rerun-if-changed={}" , dotconfig) ;
35
35
36
+ let config_n = Regex :: new ( r"(CONFIG_.*) is not set$" ) . unwrap ( ) ;
36
37
let config_y = Regex :: new ( r"^(CONFIG_.*)=y$" ) . unwrap ( ) ;
37
38
38
39
let file = File :: open ( & dotconfig) . expect ( "Unable to open dotconfig" ) ;
39
40
for line in BufReader :: new ( file) . lines ( ) {
40
41
let line = line. expect ( "reading line from dotconfig" ) ;
42
+
41
43
if let Some ( caps) = config_y. captures ( & line) {
42
44
println ! ( "cargo:rustc-cfg={}" , & caps[ 1 ] ) ;
45
+ println ! ( "cargo:rustc-check-cfg=cfg({})" , & caps[ 1 ] ) ;
46
+ } else if let Some ( caps) = config_n. captures ( & line) {
47
+ println ! ( "cargo:rustc-check-cfg=cfg({})" , & caps[ 1 ] ) ;
43
48
}
44
49
}
45
50
}
You can’t perform that action at this time.
0 commit comments