@@ -1174,10 +1174,10 @@ if not get_option('opengl').auto() or have_system or have_vhost_user_gpu
1174
1174
endif
1175
1175
1176
1176
vulkan = not_found
1177
+ libglslang = not_found
1178
+
1177
1179
if targetos == ' windows'
1178
- vulkan = declare_dependency (
1179
- compile_args : [' -DVK_USE_PLATFORM_WIN32_KHR' , ' -DVK_NO_PROTOTYPES' ],
1180
- )
1180
+ vulkan = declare_dependency (compile_args : [' -DVK_USE_PLATFORM_WIN32_KHR' ])
1181
1181
libglslang = declare_dependency (link_args : [
1182
1182
' -lglslang' ,
1183
1183
' -lMachineIndependent' ,
@@ -1188,14 +1188,21 @@ if targetos == 'windows'
1188
1188
])
1189
1189
elif targetos == ' linux'
1190
1190
vulkan = dependency (' vulkan' )
1191
- libglslang = declare_dependency (link_args : [
1192
- ' -lglslang' ,
1193
- ' -lMachineIndependent' ,
1194
- ' -lGenericCodeGen' ,
1195
- ' -lSPIRV' ,
1196
- ' -lSPIRV-Tools' ,
1197
- ' -lSPIRV-Tools-opt'
1198
- ])
1191
+ endif
1192
+
1193
+ if vulkan.found() and not libglslang.found()
1194
+ cmake = import (' cmake' )
1195
+ # FIXME: Get spirv-tools to enable opt.
1196
+ glslang_opts = cmake.subproject_options()
1197
+ glslang_opts.add_cmake_defines({' ENABLE_OPT' : false })
1198
+ glslang_subpro = cmake.subproject (' glslang' , options : glslang_opts)
1199
+ libglslang = declare_dependency (link_with : [
1200
+ glslang_subpro.target(' glslang' ),
1201
+ glslang_subpro.target(' MachineIndependent' ),
1202
+ glslang_subpro.target(' GenericCodeGen' ),
1203
+ glslang_subpro.target(' SPIRV' ),
1204
+ ], include_directories : [' subprojects' / ' glslang' ]
1205
+ )
1199
1206
endif
1200
1207
1201
1208
subdir (' thirdparty' )
0 commit comments