Skip to content

Commit

Permalink
Fix clang build on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Drago committed Nov 2, 2020
1 parent b8e36eb commit f3af3d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-Wno-switch-enum
-Wno-undef
)
# The detection of cross compilation by -Wpoison-system-directories has false positives on macOS because
# --sysroot is implicitly added. Turn the warning off.
check_c_compiler_flag(-Wpoison-system-directories HAVE_POISON_SYSTEM_DIRECTORIES_WARNING)
if(HAVE_POISON_SYSTEM_DIRECTORIES_WARNING)
add_definitions(-Wno-poison-system-directories)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_definitions(-std=c99) # Enforce C99 for gcc
MESSAGE(STATUS "Enabling warnings (for colorist lib/bin) for GCC")
Expand Down

0 comments on commit f3af3d1

Please sign in to comment.