Fix clangsupport on FreeBSD.
ClosedPublic

Authored by arrowd on Jul 24 2018, 6:30 AM.

Details

Summary

After workaround for https://bugs.kde.org/show_bug.cgi?id=393779 clangsupport plugin
on FreeBSD got broken completely. In https://phabricator.kde.org/D13613 it was agreed
that using cpuid.h header to detect Clang's built-in directory is a bit better hack.

Diff Detail

Repository
R32 KDevelop
Branch
clangsupport_freebsd
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1113
Build 1126: arc lint + arc unit
arrowd created this revision.Jul 24 2018, 6:30 AM
Restricted Application added a project: KDevelop. · View Herald TranscriptJul 24 2018, 6:30 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
arrowd requested review of this revision.Jul 24 2018, 6:30 AM
pino added a subscriber: pino.Jul 24 2018, 6:46 AM
pino added inline comments.
plugins/clang/clangsupport.cpp
182 ↗(On Diff #38294)

If you change this i18n message, then replace the file with a new placeholder (%2), adding the header as argument: this way, if in the future it needs to be changed again, the message will not require any change.

arrowd updated this revision to Diff 38297.Jul 24 2018, 7:07 AM

Make header name a parameter to i18n.

arrowd marked an inline comment as done.Jul 24 2018, 7:07 AM
pino added inline comments.Jul 24 2018, 7:08 AM
plugins/clang/clangsupport.cpp
181

Most probably this variable should not start with /.

arrowd added inline comments.Jul 24 2018, 7:22 AM
plugins/clang/clangsupport.cpp
181

This would make the code a bit uglier at the cost of a bit prettier message. Can do, if you insist.

pino requested changes to this revision.Jul 24 2018, 5:52 PM
pino added inline comments.
plugins/clang/clangsupport.cpp
181

I don't see how QFile::exists(builtinDir + QLatin1String("/") + headerToCheck) would be uglier (which is something highly subjective).
So yes, please change.

This revision now requires changes to proceed.Jul 24 2018, 5:52 PM
mwolff accepted this revision.Jul 24 2018, 8:42 PM
mwolff added a subscriber: mwolff.

either implement pinos variant or keep the old code and change the header name in two places

This revision was not accepted when it landed; it landed in state Needs Revision.Jul 25 2018, 6:20 AM
This revision was automatically updated to reflect the committed changes.