[FFmpeg-devel] [PATCH] avutil/vulkan_glslang: windows build improvements

Benjamin Cheng ben at bcheng.me
Fri Jan 17 20:27:08 EET 2025


On 2025-01-15 7:38 p.m., Koushik Dutta wrote:
> For my use case I ended up creating a custom pkgconfig file. My
> platform and compiler is windows and msvc.
> 
> I was unable to get the existing configure to work correctly with this
> environment and opted for pkgconfig as the hook for my environment. Is
> there a better way?

Usually Windows users would install the Vulkan SDK which also ships glslang.

Maybe checking if the directory $VULKAN_SDK/Include/glslang exists, and 
$VULKAN_SDK/Lib/glslang.lib exists could work?

> 
> Koush
> 
> On Tue, Jan 7, 2025 at 3:13 AM Lynne <dev at lynne.ee> wrote:
>>
>>
>>
>> On 07/01/2025 14:46, Koushik Dutta wrote:
>>> Searches pkg-config for glslang libraries.
>>> Use libavutil thread.h wrapper rather than directly including pthread.h.
>>>
>>> Signed-off-by: Koushik Dutta <koushd at gmail.com>
>>> ---
>>>    configure                  | 1 +
>>>    libavutil/vulkan_glslang.c | 2 +-
>>>    2 files changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/configure b/configure
>>> index b09e9d0436..9d7381de9c 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -6931,6 +6931,7 @@ enabled libharfbuzz       && require_pkg_config libharfbuzz harfbuzz hb.h hb_buf
>>>    enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
>>>                                -lglslang -lMachineIndependent -lGenericCodeGen \
>>>                                -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
>>> +                        check_pkg_config spirv_compiler glslang "glslang/Include/glslang_c_interface.h glslang/build_info.h" glslang_initialize_process ||
>>
>> This shouldn't work because glslang is a c++ lib, check_pkg_config uses
>> the c compiler and linker, and no pkg config file for glslang I've ever
>> seen has worked well.
>> We used to have a pkg-config check with some hacks, but it kept breaking
>> on debian.
>>
>>>                            require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
>>>                                -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
>>>                                -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ; }
>>> diff --git a/libavutil/vulkan_glslang.c b/libavutil/vulkan_glslang.c
>>> index d116b35ec5..9a985a930f 100644
>>> --- a/libavutil/vulkan_glslang.c
>>> +++ b/libavutil/vulkan_glslang.c
>>> @@ -16,7 +16,7 @@
>>>     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>>>     */
>>>
>>> -#include <pthread.h>
>>> +#include "thread.h"
>>
>> This is fine.
>>
>>>
>>>    #include <glslang/build_info.h>
>>>    #include <glslang/Include/glslang_c_interface.h>
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list