[package]
name = "diesel_codegen"
version = "0.6.1"
authors = ["Sean Griffin <sean@seantheprogrammer.com>"]
license = "MIT OR Apache-2.0"
build = "build.rs"
description = "Annotations to remove boilerplate from Diesel"
documentation = "https://github.com/sgrif/diesel/blob/master/diesel_codegen"
homepage = "http://diesel.rs"
repository = "https://github.com/sgrif/diesel/tree/master/diesel_codegen"
keywords = ["orm", "database", "postgres", "sql", "codegen"]

[build-dependencies]
syntex = { version = "0.31.0", optional = true }
syntex_syntax = { version = "0.31.0", optional = true }

[dependencies]
syntex = { version = "0.31.0", optional = true }
syntex_syntax = { version = "0.31.0", optional = true }
diesel = { version = "0.6.0", default-features = false }

[dev-dependencies]
tempdir = "0.3.4"

[features]
default = ["with-syntex", "postgres"]
nightly = []
with-syntex = ["syntex", "syntex_syntax"]
postgres = ["diesel/postgres"]
sqlite = ["diesel/sqlite"]

[lib]
name = "diesel_codegen"
plugin = true

[package]
name = "diesel_codegen"
version = "0.6.1"
authors = ["Sean Griffin <sean@seantheprogrammer.com>"]
license = "MIT OR Apache-2.0"
build = "build.rs"
description = "Annotations to remove boilerplate from Diesel"
documentation = "https://github.com/sgrif/diesel/blob/master/diesel_codegen"
homepage = "http://diesel.rs"
repository = "https://github.com/sgrif/diesel/tree/master/diesel_codegen"
keywords = ["orm", "database", "postgres", "sql", "codegen"]

[build-dependencies]
syntex = { version = "0.31.0", optional = true }
syntex_syntax = { version = "0.31.0", optional = true }

[dependencies]
syntex = { version = "0.31.0", optional = true }
syntex_syntax = { version = "0.31.0", optional = true }
diesel = { git = "https://github.com/diesel-rs/diesel.git", default-features = false }

[dev-dependencies]
tempdir = "0.3.4"

[features]
default = ["with-syntex", "postgres"]
nightly = []
with-syntex = ["syntex", "syntex_syntax"]
postgres = ["diesel/postgres"]
sqlite = ["diesel/sqlite"]

[lib]
name = "diesel_codegen"
crate-type = ["rlib", "dylib"]

Allow `diesel_codegen` to be used as an rlib or a dylib
Allow `diesel_codegen` to be used as an rlib or a dylib

`plugin=true` does 2 things. It sets the crate type to `dylib`, and sets
`prefer-dynamic` to true. This causes libpq to attempt to be linked
dynamically, requiring libpq to be on the path. If it's being used with
nightly, the resulting binary will require libpq to be on the path as
well.

While this generally isn't a problem when compiling for and running on
unix systems, for Windows it's uncommon for libpq.dll to be on the path
(on my current laptop, it is not on the path).

With this change, codegen should successfully compile/link anywhere that
libpq does (which means anywhere that diesel would have), and its
dependency on Diesel can be satisified statically. This may impact
resulting binary size, and we should keep an eye on if we need to add
more controls in the future.

One other alternative would be to break out `diesel_codegen_nightly`
into a separate crate, where it can set `plugin = true` safely. However,
this would result in the same problem when attempting to use nightly on
Windows.

Fixes #281
