-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: make sure build instructions are kept up to date
by checking to make sure that no options() are set in the cmake without documenting them in the build instructions Make a script that does this, and run it in CI. Signed-off-by: Robin Getz <rgetz@mathworks.com>
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Check the project CMake for options, which are not described in the README_BUILD.md file | ||
# At the same time, check to make sure the defaults are described properly. | ||
|
||
error=0 | ||
|
||
options() { | ||
for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) | ||
do | ||
grep option[[:space:]]*\( "${file}" | \ | ||
sed -e "s/^[[:space:]]*//g" -e "s/(/ /g" | \ | ||
awk '{print $2}' | ||
done | sort | uniq | ||
} | ||
|
||
for opt in $(options) | ||
do | ||
default=$(for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) | ||
do | ||
grep "option[[:space:]]*(${opt} " "${file}" | \ | ||
sed -e "s/^[[:space:]]*//g" -e "s/)[[:space:]]*$//" | \ | ||
awk '{print $NF}' | ||
done) | ||
if ! grep -q "${opt}.*${default}" README_BUILD.md ; then | ||
echo "no match with ${opt} set with ${default}" | ||
grep -R "${opt}" ./* | ||
error=1 | ||
fi | ||
done | ||
|
||
if [ "${error}" -eq "1" ] ; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters