cmake/cmake-strict_aliasing.patch
2014-12-17 18:45:45 -07:00

18 lines
631 B
Diff

diff -up cmake-3.1.0/Source/CMakeLists.txt.strict_aliasing cmake-3.1.0/Source/CMakeLists.txt
--- cmake-3.1.0/Source/CMakeLists.txt.strict_aliasing 2014-12-15 13:07:43.000000000 -0700
+++ cmake-3.1.0/Source/CMakeLists.txt 2014-12-17 18:44:38.547555582 -0700
@@ -388,6 +388,13 @@ if(APPLE)
cmLocalXCodeGenerator.h)
endif()
+# GCC shows strict aliasing warnings with cm_sha2.c. Turn off the
+# corresponding optimizations.
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
+ set_source_files_properties(cm_sha2.c PROPERTIES
+ COMPILE_FLAGS "-fno-strict-aliasing")
+endif()
+
if (WIN32)
set(SRCS ${SRCS}