haasn / libplacebo

Official mirror of libplacebo
http://libplacebo.org/
GNU Lesser General Public License v2.1
553 stars 69 forks source link

Is it possible to port this library to vcpkg? #67

Open wangwenx190 opened 4 years ago

wangwenx190 commented 4 years ago

vcpkg is a C++ library manager for Windows, Linux and macOS written by Microsoft. It supports CMake, meson and many other build systems.

haasn commented 4 years ago

Seems reasonable, but I don't know anything about vcpkg and I don't intend to research this. If you want to contribute a package (for any platform), I'd be happy to ACK or link to it.

wangwenx190 commented 4 years ago

I'm trying to port this library to Windows, but I found that your meson scripts do not take Windows platform into account. You are using Linux-specific parameters. I'm not familiar with meson so could you please adjust your meson scripts to make them portable to Windows? GNU FriBidi is a good example, it also uses meson and can be ported to Windows easily.

Using MinGW is impossible because vcpkg doesn't support it. It uses MSVC on Windows.

wangwenx190 commented 4 years ago

Maybe GCC only flags -> MSVC compatible flags. I don't know how fribidi does it, but it can be compiled by MSVC on Windows.

haasn commented 4 years ago

Does clang work with vcpkg?

That aside, I could see if compilation with MSVC can be made possible, but my hopes are not high. (We use e.g. preprocessor features that are only supported by GCC/clang afaict). MSVC support has never been in scope for libplacebo, mostly due to lack of interest.

In any case, I'd need some sort of compilation log or list of errors, so I can know which of the options are even causing problems.

wangwenx190 commented 4 years ago

For now, the most critical problem is meson can't find vulkan and shaderc although I have already installed them. I'm trying to find out why. I'll show you the compilation log once I got it.

However, it may take some time because I don't have much free time in my real life. Sorry for it.

feliwir commented 4 years ago

I'm interested in this aswell. @wangwenx190 is there anything how i could help you with this?

Lypheo commented 4 years ago

For now, the most critical problem is meson can't find vulkan and shaderc although I have already installed them. I'm trying to find out why. I'll show you the compilation log once I got it.

However, it may take some time because I don't have much free time in my real life. Sorry for it.

The only way I could get meson to find shaderc on windows was by hardcoding its location here like this:

    shaderc = cc.find_library(n, required: get_option('shaderc'), dirs: '<location of shaderc_shared.lib>')

This is probably extremely dumb, but hey, it compiles. ¯\_(ツ)_/¯ As for Vulkan, make sure you have an environment variable VULKAN_SDK set to the installation directory.

Edit: Alternatively you can manually add shaderc_shared.lib to your build environment’s lib directory, e.g. *tdm-gcc\lib for tdm gcc.

ghost commented 2 years ago

You can add the shaderc lib path to the user or computer LIB (setx LIB %LIB%;C:\Path\To\ShaderRC\lib from a regular command prompt without all the MSVS paths in place to make it stick without polluting future VS dev prompts) and the visual studio command prompts will preserve them at the end of their own lists... Then meson should be able to find them with just find_library, assuming it works roughly like CMake, although at that point you really only need the lib name for either CL / LINK or clang-cl.

Hlongyu commented 3 months ago

waiting for it. https://github.com/microsoft/vcpkg/issues/39791

Hlongyu commented 2 months ago

I tried but failed. some macor only work for gcc/clang. I don't know how to fix them. package-x64-windows-dbg-out.log

tips for others: to use stdatomic for msvc, you need

add_project_arguments('/experimental:c11atomics', language: 'c')

and disable atomic_test

if not cc.links(atomic_test) and cc.get_id() != 'msvc'
 build_deps += cc.find_library('atomic')
endif
Hlongyu commented 2 months ago

May be we can add to vcpkg without support msvc, only support mingw && linux