CMake/MSVC Support

Regina Obe lr at pcorp.us
Wed Jul 17 12:00:12 PDT 2024


The github CI bots will pick on it, and I can also push to gitea and gitlab so those bots can test as well.

 

Thanks,

Regina

 

From: Will Bowers <wbowers314 at gmail.com> 
Sent: Wednesday, July 17, 2024 2:20 PM
To: Regina Obe <lr at pcorp.us>
Cc: Paul Ramsey <pramsey at cleverelephant.ca>; PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
Subject: Re: CMake/MSVC Support

 

Regina,

Will do. If I submit a PR to your github mirror, will the CI bots pick up on it? Or does it need to be submitted directly to the repo on osgeo?

I can make a ticket as well if you would like.

 

On Wed, Jul 17, 2024, 12:00 PM Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> > wrote:

Will,

 

Thanks for the work thus far.  Yes we’d be willing to accept such patches assuming it doesn’t break other systems.

 

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.

 

Thanks,

Regina

 

From: Will Bowers <wbowers314 at gmail.com <mailto:wbowers314 at gmail.com> > 
Sent: Wednesday, July 17, 2024 12:56 PM
To: Paul Ramsey <pramsey at cleverelephant.ca <mailto:pramsey at cleverelephant.ca> >
Cc: Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> >; PostGIS Development Discussion <postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> >
Subject: Re: CMake/MSVC Support

 

All,

 

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.

 

Here are the changes needed that I have identified so far:

1. Macro changes needed with the way math constants in MSVC... need to define _USE_MATH_DEFINES first

2. Some lwgeom code uses __attribute__ ((format... ))

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

 

I have put together a patch for (1) and (2) here: https://github.com/postgis/postgis/compare/master...ralian:postgis-cmake:msvc_compat

(3) is going to require a lot more effort and testing. In the meantime, would you consider accepting something like this linked change?

 

Furthermore, Zimanyi, I will have a look at your CMake scripts and let you know if I build anything you might find useful.

 

On Wed, Jul 17, 2024 at 10:13 AM Paul Ramsey <pramsey at cleverelephant.ca <mailto:pramsey at cleverelephant.ca> > wrote:

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.

P

> On Jul 16, 2024, at 10:40 PM, Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> > wrote:
> 
> We had debates about it a long time ago, but none of us were interested in putting in the effort to make it work
> and those that did put in effort dropped a half done patch and left.
>  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.
>  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.
> But this is my VERY VERY opinionated rehash of history that has passed.
>  Anyone else want to give an alternative view of our CMake past history discussions.
>  Thanks,
> Regina
>   From: Will Bowers <wbowers314 at gmail.com <mailto:wbowers314 at gmail.com> > 
> Sent: Tuesday, July 16, 2024 8:00 PM
> To: postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
> Subject: CMake/MSVC Support
>  Hello,
>  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.
>  My ultimate goal is to get PostGIS building with MSVC as well.
>  Let me know if you have any resources for me, or if you are interested in someone getting this working!
> Will

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20240717/a35f6759/attachment.htm>


More information about the postgis-devel mailing list