Hopefully another linux fix

This commit is contained in:
Mirek Fidler 2022-07-15 10:04:24 +02:00
parent 34eaef290c
commit bca4378009
3 changed files with 9 additions and 7 deletions

View file

@ -29,14 +29,20 @@ String SourceLocation::ToString() const
return String() << filename << " (" << line << ":" << column << ")";
}
#ifdef PLATFORM_WIN32
String GetClangInternalIncludes()
{
static String includes;
ONCELOCK {
String dummy = ConfigFile("dummy.cpp");
Upp::SaveFile(dummy, String());
String h = Sys(GetExeDirFile("bin/clang/bin/c++") + " -v -x c++ -E " + dummy);
String h = Sys(
#ifdef PLATFORM_WIN32
GetExeDirFile("bin/clang/bin/c++") +
#else
"clang++"
#endif
" -v -x c++ -E " + dummy
);
DeleteFile(dummy);
h.Replace("\r", "");
Vector<String> ln = Split(h, '\n');
@ -48,7 +54,6 @@ String GetClangInternalIncludes()
}
return includes;
}
#endif
SourceLocation::SourceLocation(CXSourceLocation location)
{
@ -79,9 +84,7 @@ bool Clang::Parse(const String& filename, const String& content, const String& i
cmdline << RedefineMacros();
String includes = includes_;
#ifdef PLATFORM_WIN32
MergeWith(includes, ";", GetClangInternalIncludes());
#endif
Vector<String> args;
for(const String& s : Split(includes, ';'))

View file

@ -23,6 +23,7 @@ struct SourceLocation {
};
String RedefineMacros();
String GetClangInternalIncludes();
enum AdditionalKinds {
KIND_INCLUDEFILE = -1000,

View file

@ -116,8 +116,6 @@ void StartEditorMode(const Vector<String>& args, Ide& ide, bool& clset)
return Upp::GetExitCode(); \
}
String GetClangInternalIncludes();
#ifdef flagMAIN
GUI_APP_MAIN
#else