Fix meson uuid header check so it works with MSVC
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 26 May 2024 21:34:45 +0000 (17:34 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 26 Nov 2024 20:41:58 +0000 (15:41 -0500)
The OSSP uuid.h file includes unistd.h, so to use it with MSVC we need to
include the postgres include directories so it picks up our version of
that in src/include/port/win32_msvc. Adjust the meson test accordingly.

Backported from commit 7c655a04a2, so we can build release 16 with UUID

per request from Marina Polyakova

meson.build

index 8ea42dea81ffa0ae01e440e6f13c8963105a1d4c..4e59feb91dae577f8397b5d98a15f728118ac16e 100644 (file)
@@ -1463,7 +1463,10 @@ if uuidopt != 'none'
     error('unknown uuid build option value: @0@'.format(uuidopt))
   endif
 
-  if not cc.has_header_symbol(uuidheader, uuidfunc, args: test_c_args, dependencies: uuid)
+  if not cc.has_header_symbol(uuidheader, uuidfunc,
+                              args: test_c_args,
+                              include_directories: postgres_inc,
+                              dependencies: uuid)
     error('uuid library @0@ missing required function @1@'.format(uuidopt, uuidfunc))
   endif
   cdata.set('HAVE_@0@'.format(uuidheader.underscorify().to_upper()), 1)