blt_add_code_checks grabs too much for the file extension and throws an error
- Dominant language
- C++
- Stars
- 296
- Forks
- 66
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 1
Description
If given a file path such as "foo.bar.h", it will grab the ".bar.h" as the file extension. This needs to only get ".h".
Solution 1) If more than one "." then remove the first one and run get_filename_component(_ext ${_full_path} EXT) until there is only 1 (the first one).
Solution 2) Use some regex magic on the if checks for the file extension. This will need a loop because you won't be able to use IN_LIST at this point.
Solution 3) Create an string_endswith macro instead of grabbing the file extension.
Contributor guide
Research direction
Locate the blt_add_code_checks implementation and reproduce the problem with a path such as foo.bar.h. Trace how the file extension is extracted, then verify that only .h is selected and the code-check setup completes without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100