From 36b9ee5cf4f03d09f167a26e787319b59de7c746 Mon Sep 17 00:00:00 2001 From: David Seguin Date: Wed, 7 Sep 2016 23:28:50 -0400 Subject: [PATCH 1/3] 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 From 860e5840060491a73bbf1dcea4201c34b723cef1 Mon Sep 17 00:00:00 2001 From: David Seguin Date: Thu, 8 Sep 2016 11:28:15 -0400 Subject: [PATCH 2/3] Added @lethosor 's change --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eb6a1927..abb188577 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,9 +277,7 @@ endif() # 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() + if(NOT "${DFHACK_BUILD_ARCH}" STREQUAL "${DFHACK_CACHED_ARCH}") unset(ZLIB_LIBRARY CACHE) unset(CMAKE_HAVE_PTHREAD_H CACHE) endif() From 01a97f6487ea72aaeab94234d28ca627a7ba5f39 Mon Sep 17 00:00:00 2001 From: David Seguin Date: Thu, 8 Sep 2016 17:12:42 -0400 Subject: [PATCH 3/3] Made pthread required for building protobuf --- depends/protobuf/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/protobuf/CMakeLists.txt b/depends/protobuf/CMakeLists.txt index 5b54c8335..9846fd4e5 100644 --- a/depends/protobuf/CMakeLists.txt +++ b/depends/protobuf/CMakeLists.txt @@ -68,7 +68,7 @@ IF (HAVE_HASH_MAP EQUAL 0) ENDIF() IF(UNIX) - FIND_PACKAGE(Threads) + FIND_PACKAGE(Threads REQUIRED) ENDIF() CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h") @@ -247,4 +247,4 @@ IF(NOT CMAKE_CROSSCOMPILING) TARGET_LINK_LIBRARIES(protoc-bin protoc) EXPORT(TARGETS protoc-bin FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake ) -ENDIF() \ No newline at end of file +ENDIF()