Crates.io | tiaojian-macro |
lib.rs | tiaojian-macro |
version | 0.4.1 |
source | src |
created_at | 2023-11-11 04:15:24.479419 |
updated_at | 2023-11-20 13:56:54.834579 |
description | tiaojian-macro is a conditional compile proc-macro |
homepage | |
repository | https://github.com/evanzp0/tiaojian |
max_upload_size | |
id | 1031850 |
size | 17,599 |
tiaojian-macro 是使用过程宏进行条件编译的工具包,目前实现了项目中已激活的 package 的检测。
#![feature(proc_macro_hygiene)]
use tiaojian_macro::tiaojian;
fn main() {
#[tiaojian(is_active("sqlx", "sqlx-mysql"))]
println!("sqlx and sqlx-mysql are actived");
#[tiaojian(is_active("sqlx", "sqlx-sqlite"))]
println!("sqlx and sqlx-sqlite are actived");
}