meson: create libglsl declared dependency to propagate order-only deps

https://mesonbuild.com/FAQ.html#how-do-i-tell-meson-that-my-sources-use-generated-headers

A few locations had underspecified deps on the header files, and this
caused builds to fail given sufficient parallelism. Fix this by creating
an interface library that can be linked against, instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29115>
This commit is contained in:
Eli Schwartz
2024-05-08 18:42:31 -04:00
committed by Marge Bot
parent d2c084beb9
commit a4e0eb55ce
2 changed files with 14 additions and 6 deletions

View File

@@ -232,12 +232,16 @@ files_libglsl_standalone = files(
'standalone.h',
)
libglsl_headers = [
ir_expression_operation_h, cross_platform_settings_piece_all_h, bc1_glsl_h,
bc4_glsl_h, etc2_rgba_stitch_glsl_h, astc_glsl_h
]
libglsl = static_library(
'glsl',
[files_libglsl, glsl_parser, glsl_lexer_cpp, ir_expression_operation_h,
[files_libglsl, glsl_parser, glsl_lexer_cpp, libglsl_headers,
ir_expression_operation_strings_h, ir_expression_operation_constant_h,
float64_glsl_h, cross_platform_settings_piece_all_h, bc1_glsl_h, bc4_glsl_h,
etc2_rgba_stitch_glsl_h, astc_glsl_h],
float64_glsl_h],
c_args : [c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
@@ -247,6 +251,11 @@ libglsl = static_library(
build_by_default : false,
)
idep_libglsl = declare_dependency(
sources: libglsl_headers,
link_with: libglsl,
)
libglsl_standalone = static_library(
'glsl_standalone',
[files_libglsl_standalone, ir_expression_operation_h],

View File

@@ -480,8 +480,7 @@ libmesa = static_library(
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux,
inc_libmesa_asm, include_directories('main'),
],
link_with : [libglsl, libmesa_sse41],
dependencies : [idep_nir, idep_vtn, dep_vdpau, idep_mesautil],
link_with : [libmesa_sse41],
dependencies : [idep_libglsl, idep_nir, idep_vtn, dep_vdpau, idep_mesautil],
build_by_default : false,
)