Skip to content

fixed #12666 - got rid of ill-conceived USE_MATCHCOMPILER CMake option validation#6348

Merged
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:mc-cmake
May 3, 2024
Merged

fixed #12666 - got rid of ill-conceived USE_MATCHCOMPILER CMake option validation#6348
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:mc-cmake

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

I went quite overboard when I introduced the validation of the define. That was not necessary in CMake as we provide feedback on the usage of the matchcompiler. So only handle the special options and otherwise rely on the regular CMake logic.

…ion validation

I went quite overboard when I introduced the validation of the define. That was not necessary in CMake as we provide feedback on the usage of the matchcompiler. So only handle the special options and otherwise rely on the regular CMake logic.
@firewave
Copy link
Copy Markdown
Collaborator Author

@gzzi @c72578 please have a look

Sorry for the inconvenience and the delay in the fix. Will also provide a backport.

@c72578
Copy link
Copy Markdown
Contributor

c72578 commented Apr 27, 2024

@firewave I did some tests with the attached patch (for 2.14.0):
6348_2.14.0.patch

It accepts ON, On, 1, yes:

-DUSE_MATCHCOMPILER=ON
Output:
-- USE_MATCHCOMPILER =     ON
-- USE_MATCHCOMPILER_OPT = On

-DUSE_MATCHCOMPILER=On
Output:
-- USE_MATCHCOMPILER =     On
-- USE_MATCHCOMPILER_OPT = On

-DUSE_MATCHCOMPILER=1
Output:
-- USE_MATCHCOMPILER =     1
-- USE_MATCHCOMPILER_OPT = On

-DUSE_MATCHCOMPILER=yes
Output:
-- USE_MATCHCOMPILER =     yes
-- USE_MATCHCOMPILER_OPT = On

@firewave
Copy link
Copy Markdown
Collaborator Author

It accepts ON, On, 1, yes:

Yes - it now just uses the CMake logic: https://cmake.org/cmake/help/latest/command/if.html#constant (actually it is a variable but constant has the list of true/false definitions).

Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@firewave firewave merged commit c4be14d into cppcheck-opensource:main May 3, 2024
@firewave firewave deleted the mc-cmake branch May 3, 2024 14:09
firewave added a commit to firewave/cppcheck that referenced this pull request May 3, 2024
…ion validation (cppcheck-opensource#6348)

I went quite overboard when I introduced the validation of the define.
That was not necessary in CMake as we provide feedback on the usage of
the matchcompiler. So only handle the special options and otherwise rely
on the regular CMake logic.

(cherry picked from commit c4be14d)
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented May 3, 2024

Backport in #6377.

firewave added a commit that referenced this pull request May 3, 2024
…ion validation (#6348) (#6377)

I went quite overboard when I introduced the validation of the define.
That was not necessary in CMake as we provide feedback on the usage of
the matchcompiler. So only handle the special options and otherwise rely
on the regular CMake logic.

(cherry picked from commit c4be14d)
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.

3 participants