Skip to content

ZLIB cannot be found on Mac OS X 14 #876

Closed
@Timchenkovich

Description

@Timchenkovich

XCode command line tools comes with bundled zlib, which has .tld extension. this cmake file sets static lib usage for zlib, which would make static library preferred, although FindZLIB.cmake from cmake installation uses this variable to set up static linking exclusively. This results in zlib being not found, as it only searches for .a files.

# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  if(ZLIB_USE_STATIC_LIBS)
    if(WIN32)
      set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
    else()
      set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
    endif()
  endif()

Similar example for protobuf.

# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
if( Protobuf_USE_STATIC_LIBS )
  set( _protobuf_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  if(WIN32)
    set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  else()
    set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
  endif()
endif()

build-log-debug-find.txt
build-log-trace.txt

Is setting static only linking of above libraries a requirement? Definition of USERVER_USE_STATIC_LIBS suggests that those settings are unwanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions