cmake/cmake-strict_aliasing.patch

18 lines
631 B
Diff
Raw Normal View History

2014-12-18 01:45:45 +00:00
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)
2013-07-25 15:59:28 +00:00
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}