AutotoolsPM: Hide MakefileParser in cpp

Provide parseMakefile() global function instead.

Change-Id: Id2eebfb491f57f43ea0c98cec63de491fdfb9ea0
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-07-15 15:40:55 +02:00
parent 94a562fd8c
commit a70cb04bdf
3 changed files with 177 additions and 206 deletions

View File

@@ -31,11 +31,11 @@ AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target)
AutotoolsBuildSystem::~AutotoolsBuildSystem() = default;
static void parseMakefile(QPromise<MakefileParserOutputData> &promise, const QString &makefile)
static void parseMakefileImpl(QPromise<MakefileParserOutputData> &promise, const QString &makefile)
{
MakefileParser parser(makefile);
if (parser.parse(QFuture<void>(promise.future())))
promise.addResult(parser.outputData());
const auto result = parseMakefile(makefile, QFuture<void>(promise.future()));
if (result)
promise.addResult(*result);
else
promise.future().cancel();
}
@@ -46,7 +46,7 @@ void AutotoolsBuildSystem::triggerParsing()
const auto onSetup = [this, storage](Async<MakefileParserOutputData> &async) {
*storage = guardParsingRun();
async.setConcurrentCallData(parseMakefile, projectFilePath().toString());
async.setConcurrentCallData(parseMakefileImpl, projectFilePath().toString());
};
const auto onDone = [this, storage](const Async<MakefileParserOutputData> &async) {
(*storage)->markAsSuccess();