Skip to content

Commit

Permalink
Fix: Turn off unused function warning if compiling with clang on macOS
Browse files Browse the repository at this point in the history
Xcode 10 started treating the swap template specialization in the cpp as
an unused function. Because warnings are treated as errors with -Werror,
this caused the build to fail.
  • Loading branch information
asmaloney committed Jun 21, 2019
1 parent 4e11801 commit a495080
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(WARNINGS "-Werror" "-Wall")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(WARNINGS "-Werror" "-Wall")
if (APPLE)
# Xcode 10 started treating the swap template specialization in the cpp as
# an unused function and causing an error, so turn off the warning
list(APPEND WARNINGS "-Wno-unused-function")
endif()
elseif(MSVC)
set(WARNINGS "/WX" "/W4")
endif()
Expand Down

0 comments on commit a495080

Please sign in to comment.