summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-08 17:52:02 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-09 18:21:33 (GMT)
commit0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (patch)
treef00121db59536d460f80f1aa3b89ae222828936c
parentd8126d3784c149f1738865cc239a34fdd29ec442 (diff)
downloadCMake-0af4b40b6efee388251a9ee5ee22e9cfa90af7fe.zip
CMake-0af4b40b6efee388251a9ee5ee22e9cfa90af7fe.tar.gz
CMake-0af4b40b6efee388251a9ee5ee22e9cfa90af7fe.tar.bz2
liblzma: Disable GNU 3.3 compiler optimizations
The GNU 3.3 optimizer causes bad behavior in liblzma, so disable it.
-rw-r--r--Utilities/cmliblzma/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
index 991c699..8920536 100644
--- a/Utilities/cmliblzma/CMakeLists.txt
+++ b/Utilities/cmliblzma/CMakeLists.txt
@@ -215,6 +215,10 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "XL")
# Disable the XL compiler optimizer because it causes crashes
# and other bad behavior in liblzma code.
SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-qnooptimize")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
+ CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
+ # Disable the old GNU compiler optimizer.
+ SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0")
ENDIF()
INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma)