mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1630] [MERGED] [IMPROVEMENT] Use Corrosion to build Rust code #2341
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1630
Author: @emilazy
Created: 8/1/2024
Status: ✅ Merged
Merged: 8/12/2024
Merged by: @PunitLodha
Base:
master← Head:push-rozmtsmxykmp📝 Commits (2)
6d6537c[IMPROVEMENT] Use Corrosion to build Rust code741b7d5Merge branch 'master' into push-rozmtsmxykmp📊 Changes
3 files changed (+36 additions, -44 deletions)
View changed files
📝
docs/CHANGES.TXT(+1 -0)📝
src/CMakeLists.txt(+4 -4)📝
src/rust/CMakeLists.txt(+31 -40)📄 Description
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Currently, using the CMake Ninja generator fails when Rust code is enabled, because the dependencies and outputs of the Rust code compilation are not fully declared. I tried to fix this with the
BYPRODUCTSfeature, but it seemed like it wouldn’t really work. Instead, I ported the Rust build to Corrosion, which is a CMake package designed to integrate CMake and Cargo. Corrosion is used by other projects that combine C++ and Rust, like the work‐in‐progress Rust port of the fish shell. Now people can get faster, more reliable builds using Ninja, and the CMake code is simpler and cleaner.Developers and users do not need to explicitly install Corrosion, thanks to CMake’s
FetchContentfeature. However, if Corrosion is installed on the system, that version will be used.I bumped the minimum CMake requirement to 3.15.0, as Corrosion requires this version and CMake was warning that compatibility for versions as old as the current declaration will be removed in the future. However, if this is not desired, I could lower it back down so that users on older versions of CMake can still build the project as long as they disable Rust, and the
policy_maxargument ofcmake_minimum_requiredcould be used to fix the warning.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.