build.rs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. use cfg_aliases::cfg_aliases;
  5. fn main() {
  6. cfg_aliases! {
  7. custom_protocol: { feature = "custom-protocol" },
  8. dev: { not(feature = "custom-protocol") },
  9. api_all: { feature = "api-all" },
  10. // fs
  11. fs_all: { any(api_all, feature = "fs-all") },
  12. fs_read_text_file: { any(fs_all, feature = "fs-read-text-file") },
  13. fs_read_binary_file: { any(fs_all, feature = "fs-read-binary-file") },
  14. fs_write_file: { any(fs_all, feature = "fs-write-file") },
  15. fs_write_binary_file: { any(fs_all, feature = "fs-write-binary-file") },
  16. fs_read_dir: { any(fs_all, feature = "fs-read-dir") },
  17. fs_copy_file: { any(fs_all, feature = "fs-copy-file") },
  18. fs_create_dir: { any(fs_all, feature = "fs-create_dir") },
  19. fs_remove_dir: { any(fs_all, feature = "fs-remove-dir") },
  20. fs_remove_file: { any(fs_all, feature = "fs-remove-file") },
  21. fs_rename_file: { any(fs_all, feature = "fs-rename-file") },
  22. fs_path: { any(fs_all, feature = "fs-path") },
  23. // window
  24. window_all: { any(api_all, feature = "window-all") },
  25. window_create: { any(window_all, feature = "window-create") },
  26. // shell
  27. shell_all: { any(api_all, feature = "shell-all") },
  28. shell_open: { any(shell_all, feature = "shell-open") },
  29. shell_execute: { any(shell_all, feature = "shell-execute") },
  30. // dialog
  31. dialog_all: { any(api_all, feature = "dialog-all") },
  32. dialog_open: { any(dialog_all, feature = "dialog-open") },
  33. dialog_save: { any(dialog_all, feature = "dialog-save") },
  34. // http
  35. http_all: { any(api_all, feature = "http-all") },
  36. http_request: { any(http_all, feature = "http-request") },
  37. // cli
  38. cli: { feature = "cli" },
  39. // notification
  40. notification_all: { any(api_all, feature = "notification-all") },
  41. // global shortcut
  42. global_shortcut_all: { any(api_all, feature = "global_shortcut-all") },
  43. }
  44. }