From 34572042c792fe1cb58e233f9c5a6e8ed93a9d7b Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 28 Jul 2022 13:54:55 +0800 Subject: [PATCH] gallium: Move -DHAVE_PIPE_LOADER_DRI and -DHAVE_PIPE_LOADER_KMS to be pre_args There is non pipe-loader source code depends on it. After doing this, we found that shared library pipe_swrast depends on libswdri The error message is: src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'dri_create_sw_winsys' src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'kms_dri_create_winsys' Signed-off-by: Yonggang Luo Reviewed-by: Adam Jackson Part-of: --- meson.build | 7 +++++++ src/gallium/auxiliary/pipe-loader/meson.build | 6 ------ src/gallium/targets/pipe-loader/meson.build | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index a3724a16551..ae596676b84 100644 --- a/meson.build +++ b/meson.build @@ -1689,6 +1689,13 @@ if dep_libdrm.found() endif endif +if with_dri + pre_args += '-DHAVE_PIPE_LOADER_DRI' +endif +if with_gallium_drisw_kms + pre_args += '-DHAVE_PIPE_LOADER_KMS' +endif + dep_libudev = dependency('libudev', required : false) if dep_libudev.found() pre_args += '-DHAVE_LIBUDEV' diff --git a/src/gallium/auxiliary/pipe-loader/meson.build b/src/gallium/auxiliary/pipe-loader/meson.build index 988947195ec..1c768e73b62 100644 --- a/src/gallium/auxiliary/pipe-loader/meson.build +++ b/src/gallium/auxiliary/pipe-loader/meson.build @@ -33,12 +33,6 @@ if dep_libdrm.found() files_pipe_loader += files('pipe_loader_drm.c') libpipe_loader_links += libloader endif -if with_dri - libpipe_loader_defines += '-DHAVE_PIPE_LOADER_DRI' -endif -if with_gallium_drisw_kms - libpipe_loader_defines += '-DHAVE_PIPE_LOADER_KMS' -endif libpipe_loader_static = static_library( 'pipe_loader_static', diff --git a/src/gallium/targets/pipe-loader/meson.build b/src/gallium/targets/pipe-loader/meson.build index 291c4844906..59484ae8a65 100644 --- a/src/gallium/targets/pipe-loader/meson.build +++ b/src/gallium/targets/pipe-loader/meson.build @@ -67,7 +67,7 @@ pipe_loaders = [ [with_gallium_freedreno, 'msm', driver_freedreno, []], [with_gallium_kmsro, 'kmsro', _kmsro_targets, []], [with_gallium_svga, 'vmwgfx', driver_svga, []], - [with_gallium_softpipe, 'swrast', driver_swrast, [libwsw, libws_null]], + [with_gallium_softpipe, 'swrast', driver_swrast, [libwsw, libws_null, libswdri, libswkmsdri]], ] foreach x : pipe_loaders