evolutics / iftree Goto Github PK
View Code? Open in Web Editor NEWInclude many files in your Rust code for self-contained binaries
License: MIT License
Include many files in your Rust code for self-contained binaries
License: MIT License
Would there likely be an example for that?
But relative paths should always be generated with a slash "/", irrespective of platform.
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
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
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.