assignUser commented on PR #719:
URL: https://github.com/apache/arrow-nanoarrow/pull/719#issuecomment-2727571748
I think you should change `nanoarrow` explicitly to `nanoarrow_static` to be
consistent and then add a `nanoarrow::nanoarrow` alias to it (I assume static
will be the default? Or you could base that on `BUILD_SHARED_LIBS` like this
```cmake
if(BUILD_SHARED_LIBS)
add_library(nanoarrow::nanoarrow ALIAS nanoarrow_shared)
else()
add_library(nanoarrow::nanoarrow ALIAS nanoarrow_static)
endif()
```
This is mostly relevant when nanoarrow is built as a subproject. You could
also add an option that allows toggling the building of either version (gflags
does that). That way I don't have to compile everything twice if I only care
about static.
For packaging the shared bit could be made a component that also changes
which target gets the main alias. (again something gflags does
`find_package(gflags COMPONENTS shared)`
nit: You should be able to create an INTERFACE target for the sources and
use that instead of variables:
https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_SOURCES.html
I haven't used an interface target but it's a nice solution to avoid raw
variables (which I am always happy about...)
--
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]