Code Monkey home page Code Monkey logo

iftree's People

Contributors

evolutics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

happydpc

iftree's Issues

windows debug build (when built on linux) uses wrong path seperators

When building on Linux, but for Windows, via mingw and --target x86_64-pc-windows-gnu.
In release mode, everything works perfectly.
In debug mode, compilation succeeds, but the produced executable, when moved to windows, will use paths with / as seperator rather than \ and hence fail to find the resources to load.
(I am not using stock debug mode, rather a special profile I created, see #10. But should not make a difference.)

I can fix that by specifying Windows-style paths in the iftree macro invocations, e.g.
#[iftree::include_file_tree("res\\myres\\*jpg")]
But obviously then I break release-builds, because those are trying to use Linux-style paths to embed the files from current system.

Regards

debug mode on linux does not load assets from relative paths

Hey there, thank you for this cool library.

I have noticed one issue when running debug build on Linux, specifically what is profile "live" here.

[profile.release]
lto = "thin"

[profile.live]
inherits = "release"
debug-assertions = true # to enable live-embeds

I am building on Linux, then moving the executable into a different folder with different assets.
E.g.

cd ~/projects/my_project/
cargo build --profile=live
mv target/live/executable ~/my_different_env
cd ~/my_different_env
./executable

In this case, executable will not load assets relative to my_different_env, but it will still load all assets relative to ~/projects/my_project/! Meaning it probably uses absolute system paths - although in the ifree macro invocations I am only using relative paths.
Interestingly, if I cross-build for windows (--target x86_64-pc-windows-gnu) the produced executable has the correct behavior when I move it to a Windows PC and run it there. (But I am cross-compiling for windows with some adjustment, see #11, so this may be due to the fact that the paths in Windows case are impossible to resolve at build time.)

On Linux, I only figured out a workaround, if e.g. my assets are in ~/projects/my_project/assets, then I can temporarily rename that folder mv assets __assets, and link the desired ln -s ~/my_different_env/assets ~/projects/my_project/assets.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.