<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.gmail-blob-code-inner
{mso-style-name:gmail-blob-code-inner;}
span.gmail-pl-s1
{mso-style-name:gmail-pl-s1;}
span.gmail-pl-en
{mso-style-name:gmail-pl-en;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt'>Will,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Thanks for the work thus far. Yes we’d be willing to accept such patches assuming it doesn’t break other systems.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Can you submit a pull request, maybe mark it as WIP if you feel it’s not yet in a condition to be accepted. That way we can at least test more easily against our various CI bots.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Regina<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Will Bowers <wbowers314@gmail.com> <br><b>Sent:</b> Wednesday, July 17, 2024 12:56 PM<br><b>To:</b> Paul Ramsey <pramsey@cleverelephant.ca><br><b>Cc:</b> Regina Obe <lr@pcorp.us>; PostGIS Development Discussion <postgis-devel@lists.osgeo.org><br><b>Subject:</b> Re: CMake/MSVC Support<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>All,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Here are the changes needed that I have identified so far:<o:p></o:p></p></div><div><p class=MsoNormal>1. Macro changes needed with the way math constants in MSVC... need to define <span class=gmail-pl-s1>_USE_MATH_DEFINES</span> first<o:p></o:p></p></div><div><p class=MsoNormal>2. Some lwgeom code uses <span class=gmail-blob-code-inner>__attribute__ ((</span><span class=gmail-pl-en>format</span>... ))<o:p></o:p></p></div><div><p class=MsoNormal>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<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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><o:p></o:p></p></div><div><p class=MsoNormal>(3) is going to require a lot more effort and testing. In the meantime, would you consider accepting something like this linked change?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Furthermore, Zimanyi, I will have a look at your CMake scripts and let you know if I build anything you might find useful.<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Wed, Jul 17, 2024 at 10:13<span style='font-family:"Arial",sans-serif'> </span>AM Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal style='margin-bottom:12.0pt'>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<span style='font-family:"Arial",sans-serif'> </span>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><o:p></o:p></p></blockquote></div></div></div></body></html>