Given this small library which uses local crates in subdirectories, how would I make one of the dependencies optional, depending on if a feature is enabled?
[package]
name = "image_load"
description = "Small wrapper for image reading API's."
version = "0.1.0"
[features]
default = ["use_png"]
[dependencies]
[dependencies.image_load_ppm]
path = "ppm"
# How to make this build _only_ when 'use_png' feature is enabled?
[dependencies.image_load_png]
path = "png"
While I read the documentation, this shows how to have optional external dependencies. In the example above I'm using a local subdirectory, which I want to build, or not - based on a feature.
How can I make image_load_png only build when the use_png feature is enabled.