extra_cflags = ""
extra_cflags_c = ""
extra_cflags_cc = ""
+
+ compiler_prefix = ""
}
config("no_rtti") {
tool("cc") {
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{output}}"
+ command = "$compiler_prefix $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{output}}"
depsformat = "gcc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
]
- description = "$cc ... $extra_cflags $extra_cflags_c -o {{output}}"
+ description =
+ "$compiler_prefix $cc ... $extra_cflags $extra_cflags_c -o {{output}}"
}
tool("cxx") {
depfile = "{{output}}.d"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} $extra_cflags $extra_cflags_cc -c {{source}} -o {{output}}"
+ command = "$compiler_prefix $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} $extra_cflags $extra_cflags_cc -c {{source}} -o {{output}}"
depsformat = "gcc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
]
- description = "$cxx ... $extra_cflags $extra_cflags_cc -o {{output}}"
+ description =
+ "$compiler_prefix $cxx ... $extra_cflags $extra_cflags_cc -o {{output}}"
}
tool("asm") {
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
+ command = "$compiler_prefix $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
depsformat = "gcc"
outputs = [
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
]
- description = "$cc ... -o {{output}}"
+ description = "$compiler_prefix $cc ... -o {{output}}"
}
tool("alink") {
rpath = "-Wl,-install_name,@rpath/$soname"
}
- command = "$cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath -o {{output}}"
+ command = "$compiler_prefix $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath -o {{output}}"
outputs = [
"{{root_out_dir}}/$soname",
]
output_prefix = "lib"
default_output_extension = ".so"
- description = "$cxx -shared ... -o {{output}}"
+ description = "$compiler_prefix $cxx -shared ... -o {{output}}"
pool = ":link_pool"
}
tool("link") {
- command = "$cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}"
+ command = "$compiler_prefix $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}"
outputs = [
"{{root_out_dir}}/{{target_output_name}}{{output_extension}}",
]
- description = "$cxx ... -o {{output}}"
+ description = "$compiler_prefix $cxx ... -o {{output}}"
pool = ":link_pool"
}
elif compiler == 'GCC':
cc, cxx = 'gcc', 'g++'
+ compiler_prefix = ""
ccache = self.m.run.ccache()
if ccache:
- cc, cxx = '%s %s' % (ccache, cc), '%s %s' % (ccache, cxx)
+ compiler_prefix = ccache
if compiler == 'Clang':
# Stifle "argument unused during compilation: ..." warnings.
extra_cflags.append('-Qunused-arguments')
gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in {
'cc': quote(cc),
'cxx': quote(cxx),
+ 'compiler_prefix': quote(compiler_prefix),
'extra_cflags': quote(' '.join(extra_cflags)),
'is_debug': 'true' if configuration == 'Debug' else 'false',
}.iteritems())