From 1eb6b2882079f989422d74ec3777a0c846b891bc Mon Sep 17 00:00:00 2001 From: xantares Date: Sat, 9 Oct 2021 09:03:00 +0200 Subject: [PATCH] cmake: list zip libs before szip as szip libs references libz as optimized, the REMOVE_DUPLICATES strips zlib out of TLL_LIBS but not its optimized keyword resulting in an invalid list just list zip before fixes the issue (or removing the REMOVE_DUPLICATES of TLL_LIBS) --- liblib/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt index acbc09a25..85aa4699d 100644 --- a/liblib/CMakeLists.txt +++ b/liblib/CMakeLists.txt @@ -85,6 +85,10 @@ IF(HAVE_LIBDL) SET(TLL_LIBS ${LIBDL} ${TLL_LIBS}) ENDIF() +IF(ENABLE_NCZARR_ZIP) + SET(TLL_LIBS ${TLL_LIBS} ${Zip_LIBRARIES}) +ENDIF() + IF(USE_HDF5) IF(NOT MSVC) # Some version of cmake define HDF5_hdf5_LIBRARY instead of @@ -117,10 +121,6 @@ IF(ENABLE_PNETCDF AND PNETCDF) SET(TLL_LIBS ${TLL_LIBS} ${PNETCDF}) ENDIF() -IF(ENABLE_NCZARR_ZIP) - SET(TLL_LIBS ${TLL_LIBS} ${Zip_LIBRARIES}) -ENDIF() - IF(ENABLE_S3_SDK) # TARGET_LINK_DIRECTORIES(netcdf PUBLIC ${AWSSDK_LIB_DIR}) TARGET_LINK_LIBRARIES(netcdf ${AWS_LINK_LIBRARIES})