Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support sccache for the protobuf cmake build #18

Closed
wants to merge 1 commit into from

Conversation

doy-materialize
Copy link

this will try to autodetect if you are using RUSTC_WRAPPER=sccache for your top level build, but will also allow you to set it explicitly.

@doy-materialize doy-materialize requested a review from benesch June 20, 2024 22:12
@benesch
Copy link
Member

benesch commented Jun 21, 2024

As a general rule I like to keep this kind of stuff out of the build systems of the crates themselves, and push them into the downstream system that wants to drive the build in a particular way. (For example none of the crates we maintain attempt to do anything special for cross compiling—it's on the user to provide the right compiler toolchain and set the env vars in the right way.) In this case, can you just set the compiler launcher as environment variables when you compile whatever downstream crate you're compiling?

CMAKE_C_COMPILER_LAUNCHER=sccache
CMAKE_CXX_COMPILER_LAUNCHER=sccache

Or is there a particular reason that you need them set for this crate but not other crates?

@doy-materialize
Copy link
Author

ah, i didn't realize it worked that way! yeah, environment variables seem fine here.

@benesch
Copy link
Member

benesch commented Jun 21, 2024

Ah ok, sounds great!

@benesch benesch deleted the doy-sccache branch June 21, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants