Skip to content

Commit f3af3d1

Browse files
author
Joe Drago
committed
Fix clang build on macOS
1 parent b8e36eb commit f3af3d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
8585
-Wno-switch-enum
8686
-Wno-undef
8787
)
88+
# The detection of cross compilation by -Wpoison-system-directories has false positives on macOS because
89+
# --sysroot is implicitly added. Turn the warning off.
90+
check_c_compiler_flag(-Wpoison-system-directories HAVE_POISON_SYSTEM_DIRECTORIES_WARNING)
91+
if(HAVE_POISON_SYSTEM_DIRECTORIES_WARNING)
92+
add_definitions(-Wno-poison-system-directories)
93+
endif()
8894
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
8995
add_definitions(-std=c99) # Enforce C99 for gcc
9096
MESSAGE(STATUS "Enabling warnings (for colorist lib/bin) for GCC")

0 commit comments

Comments
 (0)