[package]
name = "zhipinghuiyi"
version = "0.1.0"
description = "树人教育研究院旗下智评会议APP"
authors = ["mxp131011@qq.com"]
license = ""
repository = ""
edition = "2024"
rust-version = "1.94.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "zhipinghuiyi_lib"
crate-type = ["staticlib", "cdylib", "rlib"]


[build-dependencies]
tauri-build = { version = "2.5.5", features = [] }

[features]
default = ["production"]
development = []
production = []
prod_150_8080 = []

[dependencies]
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.149", features = ["raw_value"] }
tauri-plugin-persisted-scope = "2.3.5"
log = "0.4.29"
tauri = { version = "2.10.2", features = [
  "macos-private-api",
  "tray-icon",
  "image-ico",
  "image-png",
  "devtools",
] }
tauri-plugin-os = "2.3.2"
tauri-plugin-dialog = "2.6.0"
tauri-plugin-fs = "2.4.5"
tauri-plugin-http = "2.5.7"
tauri-plugin-process = "2.3.1"
tauri-plugin-websocket = "2.4.2"
rodio = "0.22.1"
lazy_static = "1.5.0"
tokio = { version = "1.49.0", features = ["full"] }
parking_lot = "0.12.5"
once_cell = "1.21.3"
tokio-cron-scheduler = "0.15.1"
tracing = "0.1.44"
thiserror = "2.0.18"
bytes = "1.11.1"

# Linux 平台依赖：获取工作区尺寸
# [target.'cfg(target_os = "linux")'.dependencies]
# x11-dl = "2.21"

# macOS 平台依赖
# [target.'cfg(target_os = "macos")'.dependencies]
# objc2 = "0.6"
# objc2-foundation = "0.3"
# objc2-app-kit = "0.3"

# Windows 平台依赖
# [target.'cfg(target_os = "windows")'.dependencies]
# windows = { version = "0.58", features = ["Win32_UI_WindowsAndMessaging", "Win32_Foundation"] }

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-updater = "2.10.0"
tauri-plugin-single-instance = "2.4.0"


# ==================== 开发环境配置 ====================
# 优化策略：保持 opt-level = 3 的同时加快编译速度
[profile.dev]
opt-level = 3                  # 必须保持为 3
debug = 1                      # 保留最小调试信息（line tables only），加速链接
strip = "none"                 # 开发时不剥离任何信息
debug-assertions = true        # 开启调试断言，帮助发现bug
overflow-checks = true         # 开启溢出检查
lto = false                    # 关闭 LTO，大幅加快编译
codegen-units = 256            # 增加并行编译单元，加快编译（牺牲一些运行性能）
panic = 'unwind'               # 使用 unwind 以便调试
incremental = true             # 启用增量编译，大幅加快重复编译
rpath = false

# 构建依赖优化（proc-macro, build-script）
[profile.dev.build-override]
opt-level = 0                  # 构建脚本不需要优化，加快编译
debug = 0                      # 构建脚本不需要调试信息
codegen-units = 256            # 最大化并行
incremental = true

# 为特定慢编译的 crate 启用优化
# 这些 crate 编译很慢，启用优化可以显著加速编译
[profile.dev.package."*"]
opt-level = 3                  # 依赖库全优化
 

# ==================== 生产环境配置 ====================
# 性能优先 + 安全优先
[profile.release]
opt-level = 3                  # 最高优化级别（性能优先）
debug = false                   # 不包含调试信息
strip = "symbols"               # 剥离所有符号（包括调试符号和函数名），减小体积，提升安全性
debug-assertions = false        # 关闭调试断言
overflow-checks = false         # 关闭溢出检查（性能优先）
lto = "fat"                     # 完整 LTO（链接时优化），最佳性能
codegen-units = 1               # 单个代码生成单元，最佳优化
panic = 'abort'                 # panic 时直接中止，减小体积和提升性能
rpath = false                   # 不使用 rpath（安全考虑）
incremental = false             # 禁用增量编译
 