subdir('drivers/trace')
 subdir('drivers/rbug')
 subdir('winsys/sw/null')
-subdir('winsys/sw/dri')
-subdir('winsys/sw/kms-dri')
+if with_dri
+  subdir('winsys/sw/dri')
+else
+  libswdri = []
+endif
+if with_gallium_drisw_kms
+  subdir('winsys/sw/kms-dri')
+else
+  libswkmsdri = []
+endif
 subdir('winsys/sw/wrapper')
 if with_gallium_swr
   if meson.version().version_compare('< 0.44.0')
 
 # Copyright © 2017 Dylan Baker
+# Copyright © 2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
   files('dri_sw_winsys.c', 'dri_sw_winsys.h'),
   c_args : c_vis_args,
   include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux],
-  build_by_default : false,
 )
 
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
   c_args : c_vis_args,
   include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux],
   dependencies : dep_libdrm,
-  build_by_default : false,
 )