summaryrefslogtreecommitdiffstats
path: root/Utilities/cmliblzma
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-08 17:52:02 (GMT)
commite5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 (patch)
treef00121db59536d460f80f1aa3b89ae222828936c /Utilities/cmliblzma
parenta2df4a3f769a63822144c874660eb9461f233c22 (diff)
downloadCMake-e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4.zip
CMake-e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4.tar.gz
CMake-e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4.tar.bz2
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 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)