[][src]Macro embed_plist::embed_info_plist

macro_rules! embed_info_plist {
    ($path:expr) => { ... };
}

Embeds the Info.plist file at $path directly in the current binary.

Accidental Reuse Protection

Only one copy of Info.plist should exist in a binary. Accidentally embedding it multiple times would break tools that read this section.

Fortunately, this library makes reuse a compile-time error! This protection works even if this macro is reused in different modules.

This example deliberately fails to compile
embed_plist::embed_info_plist!("Info.plist");
embed_plist::embed_info_plist!("Info.plist");

Note: This check only works on Rust 1.43 and later.

This example produces the following error:

error: symbol `_EMBED_INFO_PLIST` is already defined
 --> src/main.rs:4:1
  |
4 | embed_plist::embed_info_plist!("Info.plist");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

Warning: Although the name _EMBED_INFO_PLIST can be seen here, you should not reference this symbol with e.g. an extern "C" block. I reserve the right to change this name in a SemVer-compatible update.