From 36b9ee5cf4f03d09f167a26e787319b59de7c746 Mon Sep 17 00:00:00 2001 From: David Seguin Date: Wed, 7 Sep 2016 23:28:50 -0400 Subject: [PATCH] Added check to rescan zlib and pthread on linux unset ZLIB_LIBRARY and CMAKE_HAVE_PTHREAD_H to rescan those libs when arch changes from 32 to 64 (and vis-versa). There may be a better way to do this. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a55940eff..3eb6a1927 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,6 +274,16 @@ endif() #### expose depends #### +# check for change in arch (32<->64) +if(UNIX) + GET_PROPERTY(DFHACK_CACHED_ARCH CACHE STRING PROPERTY DFHACK_BUILD_ARCH) + if("${DFHACK_BUILD_ARCH}" STREQUAL "${DFHACK_CACHED_ARCH}") + # no change + else() + unset(ZLIB_LIBRARY CACHE) + unset(CMAKE_HAVE_PTHREAD_H CACHE) + endif() +endif() # find and make available libz if(NOT UNIX) # Windows