joemarshall commented on code in PR #37821:
URL: https://github.com/apache/arrow/pull/37821#discussion_r1343086568
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -258,6 +258,21 @@ macro(resolve_dependency DEPENDENCY_NAME)
set(ARG_IS_RUNTIME_DEPENDENCY TRUE)
endif()
+ # ensure zlib is built with -fpic
+ # and make sure that the build finds the version in Emscripten ports
+ # - n.b. the actual linking happens because -sUSE_ZLIB=1 is
+ # set in the compiler variables, but cmake expects
+ # it to exist at configuration time if we aren't building it as
+ # 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")
+ if(NOT EXISTS ${EMSCRIPTEN_SYSROOT}/lib/wasm32-emscripten/pic/libz.a)
+ execute_process(COMMAND embuilder --pic --force build zlib)
+ endif()
+ set(ZLIB_LIBRARY ${EMSCRIPTEN_SYSROOT}/lib/wasm32-emscripten/pic/libz.a)
+ endif()
Review Comment:
good idea, implementing it now.
--
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]