llnl / llnl/blt

blt_add_code_checks grabs too much for the file extension and throws an error

Open
#119 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.