meson: use the driver dependencies for the gallium dri target
authorDylan Baker <dylan@pnwbakers.com>
Wed, 15 Nov 2017 18:45:29 +0000 (10:45 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Mon, 4 Dec 2017 22:35:43 +0000 (14:35 -0800)
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/gallium/targets/dri/meson.build

index c23b47216eacc3cfe3b2bade28486c9d10b4700d..5ca7b015d9160daae7ddd4544b9d92e4a1fb5489 100644 (file)
@@ -30,10 +30,8 @@ gallium_dri_c_args = [
 ]
 gallium_dri_ld_args = []
 gallium_dri_link_with = []
-gallium_dri_depends = []
 gallium_dri_link_depends = []
 gallium_dri_drivers = []
-gallium_dri_sources = []
 
 if with_ld_version_script
   gallium_dri_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'dri.sym')]
@@ -51,108 +49,14 @@ if with_gallium_drisw_kms
   gallium_dri_link_with += libswkmsdri
 endif
 
-if with_gallium_pl111
-  gallium_dri_c_args += '-DGALLIUM_PL111'
-  gallium_dri_link_with += [libpl111winsys]
-  gallium_dri_drivers += 'pl111_dri.so'
-endif
-if with_gallium_radeonsi
-  gallium_dri_c_args += '-DGALLIUM_RADEONSI'
-  gallium_dri_link_with += [
-    libradeonsi, libamdgpuwinsys, libradeon, libamd_common,
-  ]
-  gallium_dri_drivers += 'radeonsi_dri.so'
-  gallium_dri_sources += [si_driinfo_h]
-endif
-if with_gallium_nouveau
-  gallium_dri_c_args += '-DGALLIUM_NOUVEAU'
-  gallium_dri_link_with += [libnouveauwinsys, libnouveau]
-  gallium_dri_drivers += 'nouveau_dri.so'
-endif
-if with_gallium_freedreno
-  gallium_dri_c_args += '-DGALLIUM_FREEDRENO'
-  gallium_dri_link_with += [libfreedrenowinsys, libfreedreno]
-  gallium_dri_drivers += 'msm_dri.so'
-  gallium_dri_drivers += 'kgsl_dri.so'
-endif
-if with_gallium_softpipe
-  gallium_dri_c_args += '-DGALLIUM_SOFTPIPE'
-  gallium_dri_link_with += libsoftpipe
-  gallium_dri_drivers += 'swrast_dri.so'
-  if with_gallium_drisw_kms
-    gallium_dri_drivers += 'kms_swrast_dri.so'
-  endif
-  if with_llvm
-    gallium_dri_c_args += '-DGALLIUM_LLVMPIPE'
-    gallium_dri_link_with += libllvmpipe
-  endif
-endif
-if with_gallium_vc4
-  gallium_dri_c_args += '-DGALLIUM_VC4'
-  gallium_dri_link_with += [libvc4, libvc4winsys]
-  gallium_dri_drivers += 'vc4_dri.so'
-endif
-if with_gallium_vc5
-  gallium_dri_c_args += '-DGALLIUM_VC5'
-  gallium_dri_link_with += [libvc5, libvc5winsys, libbroadcom_vc5]
-  gallium_dri_drivers += 'vc5_dri.so'
-endif
-if with_gallium_etnaviv
-  gallium_dri_c_args += '-DGALLIUM_ETNAVIV'
-  gallium_dri_link_with += [libetnaviv, libetnavivdrm]
-  gallium_dri_drivers += 'etnaviv_dri.so'
-endif
-if with_gallium_imx
-  gallium_dri_c_args += '-DGALLIUM_IMX'
-  gallium_dri_link_with += libimxdrm
-  gallium_dri_drivers += 'imx-drm_dri.so'
-endif
-if with_gallium_i915
-  gallium_dri_c_args += '-DGALLIUM_I915'
-  gallium_dri_link_with += [libi915, libi915drm]
-  gallium_dri_drivers += 'i915_dri.so'
-endif
-if with_gallium_r300
-  gallium_dri_c_args += '-DGALLIUM_R300'
-  gallium_dri_link_with += libr300
-  gallium_dri_drivers += 'r300_dri.so'
-endif
-if with_gallium_r600
-  gallium_dri_c_args += '-DGALLIUM_R600'
-  gallium_dri_link_with += libr600
-  gallium_dri_drivers += 'r600_dri.so'
-endif
-if with_gallium_svga
-  gallium_dri_c_args += '-DGALLIUM_VMWGFX'
-  gallium_dri_link_with += [libsvga, libsvgadrm]
-  gallium_dri_drivers += 'vmwgfx_dri.so'
-endif
-if with_gallium_virgl
-  gallium_dri_c_args += '-DGALLIUM_VIRGL'
-  gallium_dri_link_with += [libvirgl, libvirgldrm, libvirglvtest]
-  gallium_dri_drivers += 'virtio_gpu_dri.so'
-endif
-
-if with_gallium_radeonsi or with_gallium_r300 or with_gallium_r600
-  gallium_dri_link_with += libradeonwinsys
-endif
-
-if with_gallium_vc4 or with_gallium_vc5
-  gallium_dri_link_with += libbroadcom_cle
-endif
-
-if with_gallium_vc4 or with_gallium_vc5 or with_gallium_radeonsi
-  gallium_dri_link_with += libnir
-endif
-
 libgallium_dri = shared_library(
   'gallium_dri',
-  [files('target.c'), gallium_dri_sources],
+  files('target.c'),
   include_directories : [
     inc_common, inc_util, inc_dri_common, inc_gallium_drivers,
     inc_gallium_winsys, include_directories('../../state_trackers/dri'),
   ],
-  c_args : [c_vis_args, gallium_dri_c_args],
+  c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   link_args : [ld_args_gc_sections, gallium_dri_ld_args],
   link_depends : gallium_dri_link_depends,
@@ -162,11 +66,33 @@ libgallium_dri = shared_library(
     libpipe_loader_static, libws_null, libwsw,  gallium_dri_link_with,
   ],
   dependencies : [
-    gallium_dri_depends, dep_selinux, dep_expat, dep_libdrm, dep_llvm,
-    dep_thread, dep_lmsensors,
+    dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_lmsensors, dep_thread,
+    driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
+    driver_pl111, driver_vc4, driver_vc5, driver_freedreno, driver_etnaviv,
+    driver_imx, driver_i915, driver_svga, driver_virgl,
   ],
 )
 
+foreach d : [[with_gallium_pl111, 'pl111_dri.so'],
+             [with_gallium_radeonsi, 'radeonsi_dri.so'],
+             [with_gallium_nouveau, 'nouveau_dri.so'],
+             [with_gallium_freedreno, ['msm_dri.so', 'kgsl_dri.so']],
+             [with_gallium_softpipe, 'swrast_dri.so'],
+             [with_gallium_softpipe and with_gallium_drisw_kms, 'kms_swrast_dri.so'],
+             [with_gallium_vc4, 'vc4_dri.so'],
+             [with_gallium_vc5, 'vc5_dri.so'],
+             [with_gallium_etnaviv, 'etnaviv_dri.so'],
+             [with_gallium_imx, 'imx-drm_dri.so'],
+             [with_gallium_i915, 'i915_dri.so'],
+             [with_gallium_r300, 'r300_dri.so'],
+             [with_gallium_r600, 'r600_dri.so'],
+             [with_gallium_svga, 'vmwgfx_dri.so'],
+             [with_gallium_virgl, 'virtio_gpu_dri.so']]
+  if d[0]
+    gallium_dri_drivers += d[1]
+  endif
+endforeach
+
 meson.add_install_script(
   join_paths(meson.source_root(), 'bin/install_megadrivers.py'),
   libgallium_dri.full_path(),