Skip to content

Commit c15631f

Browse files
committed
meson: Fix support for empty darwin sysroot
The -isysroot options should only be added if the sysroot resolved to a nonempty string. This matches the behavior in src/template/darwin (also documented in installation.sgml). Discussion: https://www.postgresql.org/message-id/flat/60765bf0-5027-4b23-9f78-4a365d28823f%40enterprisedb.com
1 parent 0276ae4 commit c15631f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meson.build

+4-2
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ elif host_system == 'darwin'
233233
sysroot_args = [files('src/tools/darwin_sysroot'), get_option('darwin_sysroot')]
234234
pg_sysroot = run_command(sysroot_args, check:true).stdout().strip()
235235
message('darwin sysroot: @0@'.format(pg_sysroot))
236-
cflags += ['-isysroot', pg_sysroot]
237-
ldflags += ['-isysroot', pg_sysroot]
236+
if pg_sysroot != ''
237+
cflags += ['-isysroot', pg_sysroot]
238+
ldflags += ['-isysroot', pg_sysroot]
239+
endif
238240
# meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we
239241
# don't want because a) it's different from what we do for autoconf, b) it
240242
# causes warnings starting in macOS Ventura

0 commit comments

Comments
 (0)