Skip to content

Commit

Permalink
fix(test): silence duplicate -lc++ warnings on mac
Browse files Browse the repository at this point in the history
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 <me@emillon.org>
  • Loading branch information
emillon committed Apr 30, 2024
1 parent bc57ae4 commit 864276f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/blackbox-tests/test-cases/cxx-flags.t/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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)")))

0 comments on commit 864276f

Please sign in to comment.