application_root_dir() retrieves the root direction, if possible, based on the environment variable
CARGO_MANIFEST_DIR. Cargo sets this automatically to your crate root, so that config/asset locating works correctly from the get go.
I’m trying to debug my game running VSCode + RLS + LLDB. Apparently going through that launch path does not set
CARGO_MANIFEST_DIR, resulting in
application_root_dir() returning the
target/debug folder in my crate folder. As a result, config and asset loading doesn’t work.
VSCode is a rather popular IDE for Rust at the moment, so I can’t be the only one who ran into this problem. How have others solved this? Are people symlinking assets into the target folder as a pre-build step? Adding
CARGO_MANIFSET_DIR to their
launch.json? Am I simply missing something?