Merge branch 'vardec_varass_dependency' into feature/annotations

This commit is contained in:
Tristan B. Velloza Kildaire 2023-08-20 15:43:02 +02:00
commit 72eca99384
3 changed files with 14 additions and 2 deletions

View File

@ -66,6 +66,10 @@ mixin template EmitBase()
@ArgNamed("prettygen|pg", "Generate pretty-printed code")
@(ArgConfig.optional)
bool prettyPrintCodeGen = true;
@ArgNamed("ccompiler|cc", "The system C compiler to use for DGne (C emitter)")
@(ArgConfig.optional)
string systemCC = "clang";
@ArgNamed("output|o", "Filename of generated object file")
@(ArgConfig.optional)
@ -99,6 +103,9 @@ mixin template EmitBase()
// Set whether or not to enable pre-inlining of function call arguments in DGen
compiler.getConfig().addConfig(ConfigEntry("dgen:preinline_args", preinlineArguments));
// Set the C compiler to use for DGen
compiler.getConfig().addConfig(ConfigEntry("dgen:compiler", systemCC));
// Set the paths to the object files to link in
compiler.getConfig().addConfig(ConfigEntry("linker:link_files", bruh));
}

View File

@ -1285,8 +1285,10 @@ int main()
{
try
{
//NOTE: Change to system compiler (maybe, we need to choose a good C compiler)
string[] compileArgs = ["clang", "-o", "tlang.out", file.name()];
string systemCompiler = config.getConfig("dgen:compiler").getText();
gprintln("Using system C compiler '"~systemCompiler~"' for compilation");
string[] compileArgs = [systemCompiler, "-o", "tlang.out", file.name()];
// Check for object files to be linked in
string[] objectFilesLink;

View File

@ -212,6 +212,9 @@ public final class CompilerConfiguration
/* Set the mapping to hashing of entity names for DGen (TODO: This should be changed before release) */
config.addConfig(ConfigEntry("dgen:mapper", "hashmapper"));
/* Set the system C compiler for DGen to clang */
config.addConfig(ConfigEntry("dgen:compiler", "clang"));
/**
* Configure, at compile time, the system type aliases
*/