From a4e0eb55ce4daac70a33e289705c60fd352cd10f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 8 May 2024 18:42:31 -0400 Subject: [PATCH] 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: --- src/compiler/glsl/meson.build | 15 ++++++++++++--- src/mesa/meson.build | 5 ++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build index 7d7d8bfb56b..9a5eab3f6da 100644 --- a/src/compiler/glsl/meson.build +++ b/src/compiler/glsl/meson.build @@ -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], diff --git a/src/mesa/meson.build b/src/mesa/meson.build index c44f597f1d5..8a7a454f44b 100644 --- a/src/mesa/meson.build +++ b/src/mesa/meson.build @@ -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, ) -