Giter Club home page Giter Club logo

winresource's People

Contributors

999eagle avatar benjaminri avatar blckngm avatar coder206 avatar egfx-notifications avatar eijebong avatar frodo45127 avatar gliheng avatar mdsteele avatar mxre avatar nilstrieb avatar noirotm avatar pyguy2 avatar retep998 avatar rhysd avatar skirmisher avatar svitalij avatar windsoilder avatar zedseven avatar

Stargazers

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

Watchers

 avatar  avatar

winresource's Issues

Incompatible linking modifiers `+bundle` and `+whole-archive`

rustc version: rustc 1.66.1 (90743e729 2023-01-10)
winresource version: 0.1.14

I get the following error when I cross compile from Debian 11:
"error: the linking modifiers +bundle and +whole-archive are not compatible with each other when generating rlibs"

Changing

println!("cargo:rustc-link-lib=static:+whole-archive=resource");
to:

println!("cargo:rustc-link-lib=static:-bundle,+whole-archive=resource");

resolves this issue. But i don't know if this breaks builds with previous rustc versions...


Example build.rs:

// build.rs

fn main() {
    if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows"
        && std::env::var("PROFILE").unwrap() == "release"
    {
        let mut res = winresource::WindowsResource::new();

        res.set_icon("assets/favicon.ico")
            .set("ProductName", "some name")
            .set("CompanyName", "some company")
            .set("ProductVersion", "0.1.0")
            .set("FileVersion", "0.1.0.0")
            .set("FileDescription", "some description")
            .set("LegalCopyright", "Copyright © Example")
            .compile()
            .unwrap();
    }
}

Cross-compiling with MSVC toolchain from Linux

I am using cargo-xwin to cross-compile my project from Linux using the MSVC toolchain.

I was able to make it work with a symlink for rc.exe to the LLVM provided tools llvm-rc-14, but that feels kind of hacky :)
I would like to make a PR but I am not sure what is the best approach.

Support for a multi executable build

If someone has a cargo.toml that has multiple output binaries, like this:

[[bin]]
name = "foo"
path = "bin/foo.rs"

[[bin]]
name = "bar"
path = "bin/bar.rs"

[[bin]]
name = "buzz"
path = "bin/buzz.rs"

Then there isn't a way to tell win resource which icon to apply to which binary, short of making a new cargo project.
Is this impossible due to build.rs limitations, or can it be accomplished?

Avoid including manifest into a library built from a crate with both a binary and library

If you just use the crate as described in the README.md, the manifest will also end up in the library crate and linked to crates depending on this crate. This should be documented and avoided if at all possible, as the manifest is often only meant for the binary, or for a cdylib if built and so on, but not for the rlib, or crates that depend on the crate using this crate.

Review all `cfg` usages for cross-compilation use-cases

Using #[cfg(target_os = "windows")] in build.rs (and its dependencies like lib.rs of this crate) may not work as expected because build.rs is executed on the host. This means that target_os is always equal to host_os when compiling build.rs. E.g. if we use rustc on Linux and want to cross-compile binaries that run on Windows, target_os in build.rs is "linux".

Instead, we have to use environment variables like CARGO_CFG_TARGET_OS which are set to the actual build target properties.

This may also apply to other definitions like cfg!(target_arch = "x86_64"), etc.

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.