Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I discovered that minifb uses and compiles non-Rust code for a few use cases, one of which is to make the image scaling functions optimized on Linux in all profiles.
I'm not keen on this approach, as it means that minifb is reliant on a separate compiler to build the project. As an example, I am using minifb for one of my projects, and someone who wanted to run it got a compiler error when compiling it on Linux. They didn't have a C++ compiler installed:
Ideally, I'd like to not depend on a C/C++ compiler on Linux.
One option is writing the scalar functions in Rust into their own crate, make minifb depend on that crate and ensure the profile for that dependency is always optimized:
although that means there is a second crate to be published on crates.io.
Another option is to just not optimize it, and instruct users of minifb to compile it with optimizations on all profiles:
although that means slower minifb if we want its debug info in our program. (There's also
debug = true
I guess?)What are your thoughts on this matter?
This discussion aside, I made this PR to remove the need for a C++ compiler to be installed.
In my experience, it is much more likely for a C compiler to be installed on someone's Linux machine. I hope it's a bit useful :)