summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2023-03-27 06:41:40 +0000
committerPeter Eisentraut2023-03-27 07:11:08 +0000
commitc15631f0f596b2e6c4b03f24c03289d06d008783 (patch)
tree9bac8b418998fe7b34e25907ebd442a64eae5545
parent0276ae42ddea02682f514aaea449f183229ddbbc (diff)
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
-rw-r--r--meson.build6
1 files changed, 4 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 2fe47a468c8..61e94be8641 100644
--- a/meson.build
+++ b/meson.build
@@ -233,8 +233,10 @@ elif host_system == 'darwin'
sysroot_args = [files('src/tools/darwin_sysroot'), get_option('darwin_sysroot')]
pg_sysroot = run_command(sysroot_args, check:true).stdout().strip()
message('darwin sysroot: @0@'.format(pg_sysroot))
- cflags += ['-isysroot', pg_sysroot]
- ldflags += ['-isysroot', pg_sysroot]
+ if pg_sysroot != ''
+ cflags += ['-isysroot', pg_sysroot]
+ ldflags += ['-isysroot', pg_sysroot]
+ endif
# meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we
# don't want because a) it's different from what we do for autoconf, b) it
# causes warnings starting in macOS Ventura