CMake: use signed char for recastnavigation
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2016 21:36:32 +0000 (07:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2016 21:36:32 +0000 (07:36 +1000)
External libraries may need char to be signed.

build_files/cmake/macros.cmake
extern/recastnavigation/CMakeLists.txt

index 7f19e22c39e17dfe7cfde7c94984998fab6680d2..239371c227cf2131ec2205c03bea96348e1c2763 100644 (file)
@@ -1050,6 +1050,19 @@ macro(remove_strict_flags_file
 
 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)$")
+               remove_cc_flag("-funsigned-char")
+       elseif(MSVC)
+               remove_cc_flag("/J")
+       else()
+               message(WARNING
+                       "Compiler '${CMAKE_C_COMPILER_ID}' failed to disable 'unsigned char' flag."
+                       "Build files need updating."
+               )
+       endif()
+endmacro()
 
 function(ADD_CHECK_C_COMPILER_FLAG
        _CFLAGS
index b90a36c0d8fda74aa24150adf2dfc8efe946f510..19ac6e9dde81711013d6413c4a0614a14890f30a 100644 (file)
@@ -23,6 +23,8 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+remove_cc_flag_unsigned_char()
+
 set(INC 
        Recast/Include
        Detour/Include