From daf36014586da1b3a6a275023a733954d652c497 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Wed, 7 Aug 2024 11:08:01 +0100 Subject: [PATCH] HPCC-32394 Allow targetCompiler to be configured via a #option Signed-off-by: Gavin Halliday --- ecl/eclcc/eclcc.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ecl/eclcc/eclcc.cpp b/ecl/eclcc/eclcc.cpp index e898cabece3..2aba8307f8c 100644 --- a/ecl/eclcc/eclcc.cpp +++ b/ecl/eclcc/eclcc.cpp @@ -357,7 +357,7 @@ class EclCC final : implements CUnsharedInterfaceOf void applyDebugOptions(IWorkUnit * wu); bool checkWithinRepository(StringBuffer & attributePath, const char * sourcePathname); IFileIO * createArchiveOutputFile(EclCompileInstance & instance); - ICppCompiler *createCompiler(const char * coreName, const char * sourceDir, const char * targetDir, const char *compileBatchOut); + ICppCompiler *createCompiler(const char * coreName, const char * sourceDir, const char * targetDir, CompilerType targetCompiler, const char *compileBatchOut); void evaluateResult(EclCompileInstance & instance); bool generatePrecompiledHeader(); void generateOutput(EclCompileInstance & instance); @@ -850,9 +850,9 @@ void EclCC::applyApplicationOptions(IWorkUnit * wu) //========================================================================================= -ICppCompiler * EclCC::createCompiler(const char * coreName, const char * sourceDir, const char * targetDir, const char *compileBatchOut) +ICppCompiler * EclCC::createCompiler(const char * coreName, const char * sourceDir, const char * targetDir, CompilerType targetCompiler, const char *compileBatchOut) { - Owned compiler = ::createCompiler(coreName, sourceDir, targetDir, optTargetCompiler, logVerbose, compileBatchOut); + Owned compiler = ::createCompiler(coreName, sourceDir, targetDir, targetCompiler, logVerbose, compileBatchOut); compiler->setOnlyCompile(optOnlyCompile); compiler->setCCLogPath(cclogFilename); @@ -999,7 +999,8 @@ void EclCC::instantECL(EclCompileInstance & instance, IWorkUnit *wu, const char instance.stats.cppSize = generator->getGeneratedSize(); if (generateOk && !optNoCompile) { - Owned compiler = createCompiler(processName.str(), nullptr, nullptr, optCompileBatchOut); + CompilerType targetCompiler = queryCompilerType(instance.wu, optTargetCompiler); + Owned compiler = createCompiler(processName.str(), nullptr, nullptr, targetCompiler, optCompileBatchOut); compiler->setSaveTemps(optSaveTemps); bool compileOk = true; @@ -2206,7 +2207,7 @@ bool EclCC::generatePrecompiledHeader() traceError("Cannot find eclinclude4.hpp"); return false; } - Owned compiler = createCompiler("precompile", foundPath, nullptr, nullptr); + Owned compiler = createCompiler("precompile", foundPath, nullptr, optTargetCompiler, nullptr); compiler->setDebug(true); // a precompiled header with debug can be used for no-debug, but not vice versa compiler->addSourceFile("eclinclude4.hpp", nullptr); compiler->setPrecompileHeader(true);