feat: added support for color-always option for ld.lld

This commit is contained in:
Sven Vogel 2024-10-10 20:50:21 +02:00
parent 3025ff3203
commit 044a11f28c
2 changed files with 7 additions and 1 deletions

View File

@ -41,6 +41,8 @@ typedef struct TargetLinkConfig_t {
bool colorize; bool colorize;
char *output_file; char *output_file;
char *driver; char *driver;
// entry point symbol name
char* entry;
} TargetLinkConfig; } TargetLinkConfig;
typedef enum TargetCompilationMode_t { typedef enum TargetCompilationMode_t {

View File

@ -30,10 +30,14 @@ bool lldc_link(TargetConfig* target_config, TargetLinkConfig* link_config) {
char* linker = "ld.lld"; char* linker = "ld.lld";
g_array_append_val(arguments, linker); g_array_append_val(arguments, linker);
if (is_option_set("color-always")) {
char* colored_diagnostics = "--color-diagnostics=always";
g_array_append_val(arguments, colored_diagnostics);
}
const char* optimization_level = get_optimization_level_string(target_config); const char* optimization_level = get_optimization_level_string(target_config);
g_array_append_val(arguments, optimization_level); g_array_append_val(arguments, optimization_level);
// enable dynamic linker on linux
if (extract_sys_from_triple(target_config->triple) == SYS_LINUX) if (extract_sys_from_triple(target_config->triple) == SYS_LINUX)
{ {
if (target_has_shared_dependency(link_config)) if (target_has_shared_dependency(link_config))