CMake/MSVC Support
Will Bowers
wbowers314 at gmail.com
Wed Jul 17 09:55:46 PDT 2024
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>
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> 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>
> > Sent: Tuesday, July 16, 2024 8:00 PM
> > To: 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/dfe643d5/attachment-0001.htm>
More information about the postgis-devel
mailing list