mirror of https://gitlab.freedesktop.org/mesa/mesa
meson: implement split-debug
split-debug uses C args `--gsplit-dwarf` and linker args `--gdb-index` to achieve split debug, speed up the CI linking, and allow us to distribute debug symbols standalone. Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28576>
This commit is contained in:
parent
9d5af35318
commit
44b080af07
16
meson.build
16
meson.build
|
@ -961,6 +961,22 @@ endif
|
||||||
# otherwise define MESA_DEBUG to 0
|
# otherwise define MESA_DEBUG to 0
|
||||||
pre_args += '-DMESA_DEBUG=' + (with_mesa_debug ? '1' : '0')
|
pre_args += '-DMESA_DEBUG=' + (with_mesa_debug ? '1' : '0')
|
||||||
|
|
||||||
|
with_split_debug = get_option('split-debug') \
|
||||||
|
.disable_if(not cc.compiles('''#include<stdio.h>
|
||||||
|
int main() {
|
||||||
|
printf("\n");
|
||||||
|
};''',
|
||||||
|
args : '-gsplit-dwarf',
|
||||||
|
name : 'split-dwarf support'),
|
||||||
|
error_message : 'split-debug requires compiler -gsplit-dwarf support') \
|
||||||
|
.disable_if(not cc.has_link_argument('-Wl,--gdb-index'),
|
||||||
|
error_message : 'split-debug requires the linker argument -Wl,--gdb-index')
|
||||||
|
|
||||||
|
if with_split_debug.allowed() and get_option('debug')
|
||||||
|
add_project_arguments('-gsplit-dwarf', langauge : ['c', 'cpp'])
|
||||||
|
add_project_link_arguments('-Wl,--gdb-index', language : ['c', 'cpp'])
|
||||||
|
endif
|
||||||
|
|
||||||
with_shader_cache = get_option('shader-cache') \
|
with_shader_cache = get_option('shader-cache') \
|
||||||
.require(host_machine.system() != 'windows', error_message : 'Shader Cache does not currently work on Windows') \
|
.require(host_machine.system() != 'windows', error_message : 'Shader Cache does not currently work on Windows') \
|
||||||
.allowed()
|
.allowed()
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
# Copyright © 2017-2019 Intel Corporation
|
# Copyright © 2017-2019 Intel Corporation
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
option(
|
||||||
|
'split-debug',
|
||||||
|
type : 'feature',
|
||||||
|
value : 'disabled',
|
||||||
|
description : 'split debug information (-gsplit-dwarf compile flag) and debug information in the gdb index format (--gdb-index)',
|
||||||
|
)
|
||||||
option(
|
option(
|
||||||
'platforms',
|
'platforms',
|
||||||
type : 'array',
|
type : 'array',
|
||||||
|
|
Loading…
Reference in New Issue