summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-09 18:19:29 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-09 18:19:29 (GMT)
commitf941ed7a8f48665188ca355a97c926317ff586d3 (patch)
tree501235c18b22ced190bc536d722ed210487a9735 /Utilities
parent48040c19d5f1bcec55a130fcf8f8d83db27291b4 (diff)
parente5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 (diff)
downloadCMake-f941ed7a8f48665188ca355a97c926317ff586d3.zip
CMake-f941ed7a8f48665188ca355a97c926317ff586d3.tar.gz
CMake-f941ed7a8f48665188ca355a97c926317ff586d3.tar.bz2
Merge topic 'fix-liblzma-optimize'
e5d336be liblzma: Disable GNU 3.3 compiler optimizations a2df4a3f liblzma: Disable XL compiler optimizations altogether
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmliblzma/CMakeLists.txt10
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
index d991438..8920536 100644
--- a/Utilities/cmliblzma/CMakeLists.txt
+++ b/Utilities/cmliblzma/CMakeLists.txt
@@ -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)
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
index fc54d8d..d3a6348 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -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"