summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-09 18:22:05 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-09 18:22:05 (GMT)
commit048c6d19253759b1a4405813afc4272c28721c05 (patch)
treec7bac22622ba955c4d65bd033c2541e6abb43147
parent50806a1e26e536bb5cff1d3f1768211a867de8cf (diff)
parent0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (diff)
downloadCMake-048c6d19253759b1a4405813afc4272c28721c05.zip
CMake-048c6d19253759b1a4405813afc4272c28721c05.tar.gz
CMake-048c6d19253759b1a4405813afc4272c28721c05.tar.bz2
Merge branch 'fix-liblzma-optimize' into release
-rw-r--r--Utilities/cmliblzma/CMakeLists.txt10
1 files changed, 10 insertions, 0 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)