Skip to content

Commit

Permalink
Merge pull request #19144 from ghalliday/issue32394
Browse files Browse the repository at this point in the history
HPCC-32394 Allow targetCompiler to be configured via a #option

Reviewed-by: Jake Smith <[email protected]>
Reviewed-By: Richard Chapman <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 25, 2024
2 parents 05e4950 + daf3601 commit 7d52012
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class EclCC final : implements CUnsharedInterfaceOf<ICodegenContextCallback>
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);
Expand Down Expand Up @@ -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<ICppCompiler> compiler = ::createCompiler(coreName, sourceDir, targetDir, optTargetCompiler, logVerbose, compileBatchOut);
Owned<ICppCompiler> compiler = ::createCompiler(coreName, sourceDir, targetDir, targetCompiler, logVerbose, compileBatchOut);
compiler->setOnlyCompile(optOnlyCompile);
compiler->setCCLogPath(cclogFilename);

Expand Down Expand Up @@ -999,7 +999,8 @@ void EclCC::instantECL(EclCompileInstance & instance, IWorkUnit *wu, const char
instance.stats.cppSize = generator->getGeneratedSize();
if (generateOk && !optNoCompile)
{
Owned<ICppCompiler> compiler = createCompiler(processName.str(), nullptr, nullptr, optCompileBatchOut);
CompilerType targetCompiler = queryCompilerType(instance.wu, optTargetCompiler);
Owned<ICppCompiler> compiler = createCompiler(processName.str(), nullptr, nullptr, targetCompiler, optCompileBatchOut);
compiler->setSaveTemps(optSaveTemps);

bool compileOk = true;
Expand Down Expand Up @@ -2206,7 +2207,7 @@ bool EclCC::generatePrecompiledHeader()
traceError("Cannot find eclinclude4.hpp");
return false;
}
Owned<ICppCompiler> compiler = createCompiler("precompile", foundPath, nullptr, nullptr);
Owned<ICppCompiler> 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);
Expand Down

0 comments on commit 7d52012

Please sign in to comment.