Fix Clang compiler detection on macOS.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 4 Mar 2018 06:22:05 +0000 (07:22 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 4 Mar 2018 06:39:04 +0000 (07:39 +0100)
"AppleClang" was not properly detected here. Now make the compiler ID
test a bit less compact but consistent with other code.

build_files/cmake/macros.cmake

index e3eb4d9241a61a42b88d9c530ea2500f50c820d3..eaf8c2b845b2658487c95af9b8587965d74b8be5 100644 (file)
@@ -1129,7 +1129,9 @@ endmacro()
 
 # External libs may need 'signed char' to be default.
 macro(remove_cc_flag_unsigned_char)
-       if(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|Intel)$")
+       if(CMAKE_COMPILER_IS_GNUCC OR
+          (CMAKE_C_COMPILER_ID MATCHES "Clang") OR
+          (CMAKE_C_COMPILER_ID MATCHES "Intel"))
                remove_cc_flag("-funsigned-char")
        elseif(MSVC)
                remove_cc_flag("/J")