cfg values come from those built-in to the compiler (run rustc --print=cfg to view), values set by build scripts, and extra --cfg flags passed to rustc (such as those defined in RUSTFLAGS). Do not try to match on debug_assertions or Cargo features like feature="foo"
you should use build scripts for such use cases. specifically, your script should set cargo:rustc-flags=XXXX and/or cargo:rustc-cfg=KEY[=VALUE]. see