Merge topic 'fix-liblzma-optimize'

e5d336be liblzma: Disable GNU 3.3 compiler optimizations
a2df4a3f liblzma: Disable XL compiler optimizations altogether
This commit is contained in:
Brad King 2015-04-09 14:19:29 -04:00 committed by CMake Topic Stage
commit f941ed7a8f
2 changed files with 10 additions and 3 deletions

View File

@ -211,4 +211,14 @@ ENDIF()
ADD_LIBRARY(cmliblzma ${LZMA_SRCS})
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)

View File

@ -8,9 +8,6 @@
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#if defined(__IBMC__)
# pragma options optimize=0
#endif
#include "lzma_encoder_private.h"
#include "fastpos.h"