From 1d981a002a6ee73e11d6575f486baed4b9bd703f Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Thu, 2 May 2024 09:27:44 +0200 Subject: [PATCH] fix(test): silence duplicate -lc++ warnings on mac (#10468) When linking C++ on recent macos versions, the linker will emit a duplicate `-lc++` warning which we can silence in the test suite. Signed-off-by: Etienne Millon --- .../test-cases/cxx-flags.t/dune | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/blackbox-tests/test-cases/cxx-flags.t/dune b/test/blackbox-tests/test-cases/cxx-flags.t/dune index 6f4cc7ca9042..a3c46259b87e 100644 --- a/test/blackbox-tests/test-cases/cxx-flags.t/dune +++ b/test/blackbox-tests/test-cases/cxx-flags.t/dune @@ -8,3 +8,26 @@ (libraries quad) (foreign_stubs (language cxx) (names bazexe)) (modules main)) + +(env + (_ + (ocamlopt_flags + :standard + (:include extra_flags.sexp)))) + +(rule + (enabled_if + (or + (<> %{system} macosx) + (<> %{architecture} arm64))) + (action + (write-file extra_flags.sexp "()"))) + +; with XCode 15+, the linker complains about duplicate -lc++ libraries +(rule + (enabled_if + (and + (= %{system} macosx) + (= %{architecture} arm64))) + (action + (write-file extra_flags.sexp "(-ccopt -Wl,-no_warn_duplicate_libraries)")))