Skip to content

donate-cpu.py: Enhance library configuration detection#1625

Merged
amai2012 merged 1 commit into
cppcheck-opensource:masterfrom
versat:donate_cpu_library_includes
Jan 25, 2019
Merged

donate-cpu.py: Enhance library configuration detection#1625
amai2012 merged 1 commit into
cppcheck-opensource:masterfrom
versat:donate_cpu_library_includes

Conversation

@versat
Copy link
Copy Markdown
Collaborator

@versat versat commented Jan 25, 2019

Optimize checking of different includes for the same library by using a list
instead of calling hasInclude() several times.
Add includes for gtk and qt library detection that were found missing when
looking at several daca@home packages.

Optimize checking of different includes for the same library by using a `list` instead of calling `hasInclude()` several times.
Add includes for gtk and qt library detection that were found missing when looking at several daca@home packages.
Comment thread tools/donate-cpu.py
if hasInclude('temp', ['<wx/', '"wx/']):
libraries += ' --library=wxwidgets'
if hasInclude('temp', '<QString>'):
if hasInclude('temp', ['<QString>', '<QtWidgets>', '<QtGui/']):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could one use a regex #Qt[A-Z][a-z]+> instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I thought about regexp usage. But IMHO it brings not much benefit, at least for now.

Comment thread tools/donate-cpu.py
os.chdir(workPath)
libraries = ' --library=posix'
if hasInclude('temp', '<wx/') or hasInclude('temp', '"wx/'):
if hasInclude('temp', ['<wx/', '"wx/']):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not exactly addressing this PR, but: using <> vs. "" should be supported the same way for all headers.
If we want to "promote" using <> then wxWidgets should be no exception.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we want to "promote" using <> then wxWidgets should be no exception.

yes. hmm I added this even though I really don't like it. I did it because this misuse is apparently common practice.

@amai2012 amai2012 merged commit 1066ef8 into cppcheck-opensource:master Jan 25, 2019
@versat versat deleted the donate_cpu_library_includes branch January 26, 2019 10:50
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