<div dir="ltr"><div>All,</div><div><br></div><div>Thanks for the info. Like anyone else, I have personal opinions about CMake and Meson, but those aren't terribly important right now. There are some source-level changes needed to build postgis (and with some of the lwgeom source files bundled with postgis, which I assume is some kind of fork of lwgeom)... until those changes are made, can't compile on MSVC with CMake, Meson, or anything else.<br></div><div><br></div><div>Here are the changes needed that I have identified so far:<br></div><div>1. Macro changes needed with the way math constants in MSVC... need to define 
<span class="gmail-blob-code-inner gmail-blob-code-marker gmail-js-code-nav-pass"><span class="gmail-pl-s1">_USE_MATH_DEFINES</span></span> first</div><div>2. Some lwgeom code uses 
<span class="gmail-blob-code-inner gmail-blob-code-marker gmail-js-code-nav-pass">__attribute__ ((<span class="gmail-pl-en">format</span></span>... ))</div><div>3. There are some predeclarations that trigger compiler error C2375 even with /std:c17 because of the way you expose symbols to DLLs in MSVC</div><div><br></div><div>I have put together a patch for (1) and (2) here: <a href="https://github.com/postgis/postgis/compare/master...ralian:postgis-cmake:msvc_compat">https://github.com/postgis/postgis/compare/master...ralian:postgis-cmake:msvc_compat</a></div><div>(3) is going to require a lot more effort and testing. In the meantime, would you consider accepting something like this linked change?</div><div><br></div><div>Furthermore, Zimanyi, I will have a look at your CMake scripts and let you know if I build anything you might find useful.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2024 at 10:13 AM Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Tracks right for me. Cmake and postgis has never been a priority, mostly because we need to integrate with the postgresql build, and nothing happened there for cmake. As Regina mentioned, doing something with meson is a more fruitful path to an MSVC build, at this point.<br>
<br>
P<br>
<br>
> On Jul 16, 2024, at 10:40 PM, Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>> wrote:<br>
> <br>
> We had debates about it a long time ago, but none of us were interested in putting in the effort to make it work<br>
> and those that did put in effort dropped a half done patch and left.<br>
>  Even though I’m a windows user, I don’t like using MSVC except when I’m forced to so I’m personally not interested in working on CMake just to support MSVC.<br>
>  If we go any route, it would be most likely Meson to be in line with PostgreSQL proper which does support MSVC in their Meson tooling.<br>
> But this is my VERY VERY opinionated rehash of history that has passed.<br>
>  Anyone else want to give an alternative view of our CMake past history discussions.<br>
>  Thanks,<br>
> Regina<br>
>   From: Will Bowers <<a href="mailto:wbowers314@gmail.com" target="_blank">wbowers314@gmail.com</a>> <br>
> Sent: Tuesday, July 16, 2024 8:00 PM<br>
> To: <a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
> Subject: CMake/MSVC Support<br>
>  Hello,<br>
>  I was wondering if PostGIS has any current, past, or planned support for CMake? I have seen some old forks of PostGIS with some CMake project files. I also saw some very old posts talking about building PostGIS with CMake, but I don't see anything up to date on the subject.<br>
>  My ultimate goal is to get PostGIS building with MSVC as well.<br>
>  Let me know if you have any resources for me, or if you are interested in someone getting this working!<br>
> Will<br>
<br>
<br>
</blockquote></div>