1+ #![ cfg_attr( published_docs, feature( doc_cfg) ) ]
12/*
23 * Copyright (c) godot-rust; Bromeon and contributors.
34 * This Source Code Form is subject to the terms of the Mozilla Public
@@ -42,10 +43,10 @@ pub struct GodotVersion {
4243// Custom mode: Regenerate all files
4344
4445// This file is explicitly included in unit tests. Needs regex dependency.
45- #[ cfg( test) ]
46+ #[ cfg( test) ] # [ cfg_attr ( published_docs , doc ( cfg ( test ) ) ) ]
4647mod godot_version;
4748
48- #[ cfg( feature = "api-custom" ) ]
49+ #[ cfg( feature = "api-custom" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "api-custom" ) ) ) ]
4950#[ path = "" ]
5051mod depend_on_custom {
5152 use std:: borrow:: Cow ;
@@ -64,7 +65,7 @@ mod depend_on_custom {
6465 godot_exe:: write_gdextension_headers ( h_path, rs_path, false , watch) ;
6566 }
6667
67- #[ cfg( feature = "api-custom-extheader" ) ]
68+ #[ cfg( feature = "api-custom-extheader" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "api-custom-extheader" ) ) ) ]
6869 pub fn write_gdextension_headers_from_c ( h_path : & Path , rs_path : & Path , watch : & mut StopWatch ) {
6970 godot_exe:: write_gdextension_headers ( h_path, rs_path, true , watch) ;
7071 }
@@ -74,13 +75,13 @@ mod depend_on_custom {
7475 }
7576}
7677
77- #[ cfg( feature = "api-custom" ) ]
78+ #[ cfg( feature = "api-custom" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "api-custom" ) ) ) ]
7879pub use depend_on_custom:: * ;
7980
8081// ----------------------------------------------------------------------------------------------------------------------------------------------
8182// Custom mode: Generate all files based on user provided JSON.
8283
83- #[ cfg( feature = "api-custom-json" ) ]
84+ #[ cfg( feature = "api-custom-json" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "api-custom-json" ) ) ) ]
8485#[ path = "" ]
8586mod depend_on_custom_json {
8687 use std:: borrow:: Cow ;
@@ -106,13 +107,13 @@ mod depend_on_custom_json {
106107 }
107108}
108109
109- #[ cfg( feature = "api-custom-json" ) ]
110+ #[ cfg( feature = "api-custom-json" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "api-custom-json" ) ) ) ]
110111pub use depend_on_custom_json:: * ;
111112
112113// ----------------------------------------------------------------------------------------------------------------------------------------------
113114// Prebuilt mode: Reuse existing files
114115
115- #[ cfg( not( any( feature = "api-custom" , feature = "api-custom-json" ) ) ) ]
116+ #[ cfg( not( any( feature = "api-custom" , feature = "api-custom-json" ) ) ) ] # [ cfg_attr ( published_docs , doc ( cfg ( not ( any ( feature = "api-custom" , feature = "api-custom-json" ) ) ) ) ) ]
116117#[ path = "" ]
117118mod depend_on_prebuilt {
118119 use super :: * ;
@@ -183,7 +184,7 @@ mod depend_on_prebuilt {
183184 }
184185}
185186
186- #[ cfg( not( any( feature = "api-custom" , feature = "api-custom-json" ) ) ) ]
187+ #[ cfg( not( any( feature = "api-custom" , feature = "api-custom-json" ) ) ) ] # [ cfg_attr ( published_docs , doc ( cfg ( not ( any ( feature = "api-custom" , feature = "api-custom-json" ) ) ) ) ) ]
187188pub use depend_on_prebuilt:: * ;
188189
189190// ----------------------------------------------------------------------------------------------------------------------------------------------
@@ -247,7 +248,7 @@ pub fn emit_wasm_nothreads_cfg() {
247248
248249 // The environment variable for target family has a list of applicable families separated by commas.
249250 // For Emscripten in particular, this can be "unix,wasm". Therefore, to check for the Wasm target, we must check each item in the list.
250- #[ cfg( feature = "experimental-wasm-nothreads" ) ]
251+ #[ cfg( feature = "experimental-wasm-nothreads" ) ] # [ cfg_attr ( published_docs , doc ( cfg ( feature = "experimental-wasm-nothreads" ) ) ) ]
251252 if std:: env:: var ( "CARGO_CFG_TARGET_FAMILY" )
252253 . expect ( "target family environment variable" )
253254 . split ( ',' )
@@ -302,11 +303,11 @@ pub fn emit_safeguard_levels() {
302303 let mut safeguards_level = if cfg ! ( debug_assertions) { 2 } else { 1 } ;
303304
304305 // Override default level with Cargo feature, in dev/release profiles.
305- #[ cfg( debug_assertions) ]
306+ #[ cfg( debug_assertions) ] # [ cfg_attr ( published_docs , doc ( cfg ( debug_assertions ) ) ) ]
306307 if cfg ! ( feature = "safeguards-dev-balanced" ) {
307308 safeguards_level = 1 ;
308309 }
309- #[ cfg( not( debug_assertions) ) ]
310+ #[ cfg( not( debug_assertions) ) ] # [ cfg_attr ( published_docs , doc ( cfg ( not ( debug_assertions ) ) ) ) ]
310311 if cfg ! ( feature = "safeguards-release-disengaged" ) {
311312 safeguards_level = 0 ;
312313 }
@@ -326,7 +327,7 @@ pub fn emit_safeguard_levels() {
326327/// Try `new_name` env var first, fall back to `old_name` with a deprecation warning (only from `godot-codegen` build).
327328/// The `once` static ensures the warning is emitted at most once per build.
328329// TODO(v0.6): remove old names.
329- #[ cfg( any( feature = "api-custom" , feature = "api-custom-json" ) ) ]
330+ #[ cfg( any( feature = "api-custom" , feature = "api-custom-json" ) ) ] # [ cfg_attr ( published_docs , doc ( cfg ( any ( feature = "api-custom" , feature = "api-custom-json" ) ) ) ) ]
330331pub ( crate ) fn env_var_or_deprecated (
331332 once : & ' static std:: sync:: Once ,
332333 new_name : & str ,
0 commit comments