bkietz commented on code in PR #562:
URL: https://github.com/apache/arrow-nanoarrow/pull/562#discussion_r1684927290
##########
thirdparty/zlib/CMakeLists.txt:
##########
@@ -23,3 +23,4 @@ fetchcontent_makeavailable(nanoarrow_zlib)
add_library(ZLIB::ZLIB ALIAS zlibstatic)
target_include_directories(zlibstatic INTERFACE ${zlib_BINARY_DIR}
${zlib_SOURCE_DIR})
+target_include_directories(zlib INTERFACE ${zlib_BINARY_DIR}
${zlib_SOURCE_DIR})
Review Comment:
I needed this when building against conda. Without it, building the bundled
zlib raises
```
/home/ben/nanoarrow/build/_deps/nanoarrow_zlib-src/test/example.c:8:10:
fatal error: zlib.h: No such file or directory
8 | #include "zlib.h"
| ^~~~~~~~
```
Ideally there would be an option we could pass to fetchcontent in order to
disable building tests, but it seems unconditional. Since the test links to
zlib (and not to zlibstatic), the include directories attached to zlibstatic
don't apply. I don't know why this isn't failing more places; presumably
there's just another zlib.h that they can always pick up.
From the fetchcontent'd CMakeLists.txt for zlib:
```cmake
#============================================================================
# Example binaries
#============================================================================
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
```
--
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]