[Bf-blender-cvs] [89df672] master: CMake: use signed char for recastnavigation

Campbell Barton noreply at git.blender.org
Wed May 18 23:30:19 CEST 2016


Commit: 89df6720be8c54d56d64cbecd1440945ad6f5e64
Author: Campbell Barton
Date:   Thu May 19 07:36:32 2016 +1000
Branches: master
https://developer.blender.org/rB89df6720be8c54d56d64cbecd1440945ad6f5e64

CMake: use signed char for recastnavigation

External libraries may need char to be signed.

===================================================================

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

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 7f19e22..239371c 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -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
diff --git a/extern/recastnavigation/CMakeLists.txt b/extern/recastnavigation/CMakeLists.txt
index b90a36c..19ac6e9 100644
--- a/extern/recastnavigation/CMakeLists.txt
+++ b/extern/recastnavigation/CMakeLists.txt
@@ -23,6 +23,8 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+remove_cc_flag_unsigned_char()
+
 set(INC 
 	Recast/Include
 	Detour/Include




More information about the Bf-blender-cvs mailing list