Remove rename-register warning with Clang
@@ -10,6 +10,12 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-std=c99 -Wall -O3 -fno-exceptions -frename-registers -fno-signed-zeros -fno-trapping-math ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # using Clang, do not use the rename-registers optimization
+else
+ set(CMAKE_C_FLAGS "-frename-registers ${CMAKE_C_FLAGS}")
+endif()
+
if(DISABLE_DEBUG_PRINTF)
set(CMAKE_C_FLAGS "-DDISABLE_DEBUG_PRINTF ${CMAKE_C_FLAGS}")
endif()
