Fix meson uuid header check so it works with MSVC
authorAndrew Dunstan <[email protected]>
Sun, 26 May 2024 21:34:45 +0000 (17:34 -0400)
committerAndrew Dunstan <[email protected]>
Sun, 26 May 2024 21:34:45 +0000 (17:34 -0400)
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.

meson.build

index f5ca5cfed49ef744d1fc0ae450eb5e82faa8209c..d6401fb8e30ad2b9bcf6959837a0947aa13ae16d 100644 (file)
@@ -1353,7 +1353,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)