Building Synfig using MSVC

Hi all,

I managed to build a somewhat fully functional Synfig using MSVC (except for ImageMagick dependency). I basically rebuilt all the dependencies from source, which was quite the chore, but I figured that if I were to write conan/vcpkg recipes, I would have to learn to do this.

As for changes to synfig, they were minimal.

Primarily, the hack used in “valuenode_registery.h” to register value nodes does not work with MSVC

As can be seen here:
Works with gcc: godbolt
Doesn’t work with MSVC: godbolt

I used a simpler method to replace it:

Also a couple of small changes to the CMake scripts.

The result is that building synfig with MSVC is as easy as passing the flags:
-DCMAKE_PREFIX_PATH="${prefix}" -DLTDL_LIBRARIES="${prefix}/lib/libltdl.dll.a" to cmake. And Pkg config is used as in the MinGW build to find dependencies inside the prefix.

I will look into conan next as I think it’s a more viable option than vcpkg since there are missing dependencies in vcpkg, and conan is decentralized, and there is no need for any external approval.

https://drive.google.com/file/d/10MX3IXb6IN9jZoSGrubnxzTrLBCo2Kr2/view?usp=sharing

2 Likes

Honestly being able to build synfig using MSVC would save a lot, especially for people like me who prefer to use it. So that’s actually great. I hope you end up fixing everything so that it’s completely buildable it would be really helpful. Its something I personally came into trouble with when first building synfig and I would assume it happened with many others.

1 Like