Fix change to CMakeLists.txt

change CMakeLists.txt to use add_definitions instead of add_compile_definitions on old versions of cmake
pull/2389/head
Charlie Gettys 2019-03-27 11:43:21 -04:00 committed by GitHub
parent 769dd42b73
commit d718793163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -865,7 +865,13 @@ SET( ziplib_SRCS
../contrib/zip/src/zip.c
../contrib/zip/src/zip.h
)
add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0)
# TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
else
add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
endif
SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )