[zeromq-dev] Using DRAFT methods of zeromq's build libraries

Bill Torpey wallstprog at gmail.com
Mon Nov 2 20:42:02 CET 2020


May not be relevant to czmq, but vanilla libzmq has a hack in its CMakeLists.txt (checks for .git directory and enables draft if found):

if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  message(STATUS "Build and install draft classes and methods")
  option(ENABLE_DRAFTS "Build and install draft classes and methods" ON)
else()
  message(STATUS "Not building draft classes and methods")
  option(ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
endif()


> On Nov 2, 2020, at 2:21 PM, Arnaud Loonstra <arnaud at sphaero.org> wrote:
> 
> Just a quick question. Would one need to define CZMQ_BUILD_DRAFT_API in their own project in order to use the DRAFT methods?
> 
> For example using CMake I build the libs like this (paste from appveyor):
>  - cmd: |
>      cd "%LIBZMQ_BUILDDIR%"
>      cmake .. -DBUILD_STATIC=OFF -DBUILD_SHARED=ON -DZMQ_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
>      cmake --build . --config %Configuration% --target install
>  - cmd: |
>      cd "%CZMQ_BUILDDIR%"
>      cmake .. -DCZMQ_BUILD_STATIC=OFF -DCZMQ_BUILD_SHARED=ON -DCMAKE_PREFIX_PATH="C:\tmp\ci_build" -DCMAKE_INSTALL_PRE
> FIX="%INSTALL_PREFIX%"
>      cmake --build . --config %Configuration% --target install
> 
> Draft methods are enabled by default. But when using a draft method I get unresolved external symbols (Windows)
> 
> This goes away when doing #define CZMQ_BUILD_DRAFT_API before including czmq.h.
> 
> However I'm questioning this as using make on Linux does not show this and I never have needed to define this.
> 
> So feature or bug?
> 
> Rg,
> 
> Arnaud
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20201102/7a22fa40/attachment.htm>


More information about the zeromq-dev mailing list