liblzma: Disable GNU 3.3 compiler optimizations

The GNU 3.3 optimizer causes bad behavior in liblzma, so disable it.
This commit is contained in:
Brad King 2015-04-08 13:52:02 -04:00
parent d8126d3784
commit 0af4b40b6e
1 changed files with 4 additions and 0 deletions

View File

@ -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)