From b6ad6f5aec8c562d949c5ee689ad287f6f9272c1 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Fri, 29 Sep 2023 01:54:26 +0100 Subject: [PATCH] meson: Implemented a guard for LTO on macOS w/ GCC as this is broken --- src/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/meson.build b/src/meson.build index 0c8de63..eb05d15 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,6 +3,13 @@ # SPDX-FileContributor: Written by Rachel Mant cxx = meson.get_compiler('cpp') +if get_option('b_lto') and host_machine.system() == 'darwin' and cxx.get_id() == 'gcc' + error( + 'GCC on macOS does not correctly implement support for LTO, please pass `-Db_lto=false` to Meson\n' + '-> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111635 for details' + ) +endif + if cxx.get_id() == 'msvc' and cxx.version().version_compare('<19.37') error('Your compiler is broken, please upgrade to at least MSVC 2022 release 17.7 to build bmpflash with MSVC.') endif