alinaliBQ commented on code in PR #49583:
URL: https://github.com/apache/arrow/pull/49583#discussion_r2977158046


##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -2689,51 +2689,53 @@ macro(build_zlib)
   # bundled. We need to do this for all packages
   # not just zlib as some depend on zlib, but we don't rebuild
   # if it exists already
-  if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
-    # build zlib using Emscripten ports
-    if(NOT EXISTS ${EMSCRIPTEN_SYSROOT}/lib/wasm32-emscripten/pic/libz.a)
-      execute_process(COMMAND embuilder --pic --force build zlib)
-    endif()
-    add_library(ZLIB::ZLIB STATIC IMPORTED)
-    set_property(TARGET ZLIB::ZLIB
-                 PROPERTY IMPORTED_LOCATION
-                          
"${EMSCRIPTEN_SYSROOT}/lib/wasm32-emscripten/pic/libz.a")
-    target_include_directories(ZLIB::ZLIB INTERFACE 
"${EMSCRIPTEN_SYSROOT}/include")
-    list(APPEND ARROW_BUNDLED_STATIC_LIBS ZLIB::ZLIB)
-  else()
-    set(ZLIB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/zlib_ep/src/zlib_ep-install")
-    if(MSVC)
-      if(${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
-        set(ZLIB_STATIC_LIB_NAME zlibstaticd.lib)
-      else()
-        set(ZLIB_STATIC_LIB_NAME zlibstatic.lib)
+  if(NOT TARGET ZLIB::ZLIB)

Review Comment:
   On Debian, if target `ZLIB::ZLIB` already exists via `zlib1g-dev` install, 
we get build issues. (I don't have a link to the failed build since the logs 
have expired)
   
   ```
   CMake Error at cmake_modules/ThirdpartyToolchain.cmake:2716 (add_library):
     add_library cannot create imported target "ZLIB::ZLIB" because another
     target with the same name already exists.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to