Module: Mesa Branch: main Commit: 45fca7b44066826ba0ccfccd44b9d02d78714049 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=45fca7b44066826ba0ccfccd44b9d02d78714049
Author: Alyssa Rosenzweig <[email protected]> Date: Sat May 7 21:09:11 2022 -0400 mesa/st: Fix building tests on macOS Due to an upstream bug, macOS can't link empty static libraries. There is open Meson bug about this use case [1], though arguably the issue is macOS's implementation of ar. Of course, the functionality is mostly useless. The removal of GLSL-to-TGSI trivialized a static library, causing linking to fail. This commit garbage collects the useless library. This fixes the build on macOS: FAILED: src/mesa/state_tracker/tests/libmesa_st_test_common.a rm -f src/mesa/state_tracker/tests/libmesa_st_test_common.a && ar csr src/mesa/state_tracker/tests/libmesa_st_test_common.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... ar -m [-TLsv] archive file ... ar -m [-abiTLsv] position archive file ... ar -p [-TLsv] archive [file ...] ar -q [-cTLsv] archive file ... ar -r [-cuTLsv] archive file ... ar -r [-abciuTLsv] position archive file ... ar -t [-TLsv] archive [file ...] ar -x [-ouTLsv] archive [file ...] [1] https://github.com/mesonbuild/meson/issues/3735 Fixes: 214c774ba6c ("mesa/st: Remove st_glsl_to_tgsi.") Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Emma Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16385> --- src/mesa/state_tracker/tests/meson.build | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mesa/state_tracker/tests/meson.build b/src/mesa/state_tracker/tests/meson.build index bd81d5ded04..240a7dd8b44 100644 --- a/src/mesa/state_tracker/tests/meson.build +++ b/src/mesa/state_tracker/tests/meson.build @@ -18,12 +18,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -libmesa_st_test_common = static_library( - 'mesa_st_test_common', - include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], - dependencies : [idep_gtest, idep_mesautil], -) - test( 'st_format_test', executable( @@ -31,9 +25,9 @@ test( ['st_format.c'], include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], link_with : [ - libmesa_st_test_common, libmesa, libglapi, libgallium, + libmesa, libglapi, libgallium, ], - dependencies : idep_mesautil, + dependencies : [idep_gtest, idep_mesautil], ), suite : ['st_mesa'], )
