summaryrefslogtreecommitdiff
path: root/Utilities/cmliblzma
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-08 13:52:02 -0400
committerBrad King <brad.king@kitware.com>2015-04-08 13:52:02 -0400
commite5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 (patch)
treef00121db59536d460f80f1aa3b89ae222828936c /Utilities/cmliblzma
parenta2df4a3f769a63822144c874660eb9461f233c22 (diff)
downloadcmake-e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4.tar.gz
liblzma: Disable GNU 3.3 compiler optimizations
The GNU 3.3 optimizer causes bad behavior in liblzma, so disable it.
Diffstat (limited to 'Utilities/cmliblzma')
-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 991c699e66..89205366f6 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)