-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Add CMakeCache.txt detection to CMake module #1795
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a few suggestions to fix the changes can you also update the config docs to match these changes.
src/modules/cmake.rs
Outdated
@@ -77,7 +77,17 @@ mod tests { | |||
let dir = tempfile::tempdir()?; | |||
File::create(dir.path().join("CMakeLists.txt"))?.sync_all()?; | |||
let actual = ModuleRenderer::new("cmake").path(dir.path()).collect(); | |||
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); | |||
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what has happened here but it looks like the symbol used here has changed and that is why the tests are failing.
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); | |
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); |
src/modules/cmake.rs
Outdated
let dir = tempfile::tempdir()?; | ||
File::create(dir.path().join("CMakeCache.txt"))?.sync_all()?; | ||
let actual = ModuleRenderer::new("cmake").path(dir.path()).collect(); | ||
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); | |
let expected = Some(format!("via {} ", Color::Blue.bold().paint("喝 v3.17.3"))); |
Thanks for taking a look at it and figuring this out. I will update the docs once the tests are working. |
Thanks for your contribution @cschlosser |
) * Add CMakeCache.txt to cmake module * Remove trailing whitespace * Apply fixes by @andytom * Add CMakeCache.txt to docs * Revert documentation for languages other than en
Description
For CMake it also makes sense to check if we're currently in the build folder.
This is done by checking for the existence of
CMakeCache.txt
.Motivation and Context
Now it also marks a
build
folder asCMake
related.This is actually where must users will spend most of their time as it's the location where the actual build system is called.
Screenshots (if appropriate):
How Has This Been Tested?
Checklist: