Skip to content

add support for vcxproj ExcludedFromBuild - #8759

Closed
IOBYTE wants to merge 2 commits into
cppcheck-opensource:mainfrom
IOBYTE:main
Closed

add support for vcxproj ExcludedFromBuild#8759
IOBYTE wants to merge 2 commits into
cppcheck-opensource:mainfrom
IOBYTE:main

Conversation

@IOBYTE

@IOBYTEIOBYTE commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

CMake generates a vcxproj file for the cppcheck GUI that has generated files for all configurations but adds ExcludedFromBuild so the files only gets compiled for a specific configuration.

<ClCompile Include="C:\Users\Bob\forks\cppcheck\build\gui\cppcheck-gui_autogen\mocs_compilation_Debug.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">true</ExcludedFromBuild>
</ClCompile>

This patch adds support for ExcludedFromBuild so a file only gets checked for a specific configuration.

@IOBYTE
IOBYTE requested a review from danmarJuly 28, 2026 21:22
Comment threadlib/importproject.cpp
const char* text = childElement->GetText();
if (!condition || !text)
continue;
const std::string cond(condition);

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

I found some existing code that does this. I'll try to use it.

@IOBYTE

Copy link
Copy Markdown
CollaboratorAuthor

It will require major changes to use the existing code so I will close this for now.

@IOBYTEIOBYTE closed this Jul 29, 2026
Sign up for freeto 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.

1 participant

@IOBYTE