[ https://issues.apache.org/jira/browse/ZOOKEEPER-2756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011438#comment-16011438 ]
ASF GitHub Bot commented on ZOOKEEPER-2756: ------------------------------------------- GitHub user andschwa opened a pull request: https://github.com/apache/zookeeper/pull/255 ZOOKEEPER-2756: Add CMake build system for better cross-platform support ZOOKEEPER-2756: Add CMake build system for better cross-platform support This notably lacks Solaris and libtool support. Almost everything else from Autotools has been ported, including header/function/library checks, and all targets (zookeeper, hashtable, cli, load_gen, and tests). Both Linux and Windows are supported. The primary work involved (other than the writing of `CMakeLists.txt`) was transitioning the hand-written `winconfig.h` to an auto-generated `config.h` file, and guarding code with `#ifdef HAVE_FEATURE`. The `cmake_config.h.in` template was modeled after the Autotools config file so that the feature guards share the same names. While `load_gen.c` looks at first glance as if it were ported to Windows, it never actually was, so the erroneous `#include "win32port.h"` was removed, and the target is not built on Windows. There are existent warnings which this patch did not attempt to fix, save a few easy ones (set but unused `rc` variable). Fix DLL_EXPORT and USE_STATIC_LIB redefinition. Some changes to `winconfig.h` necessary to build with Visual Studio 2015 (and 2017) were included; these originally came from a patch embedded inside the Mesos build process. You can merge this pull request into a Git repository by running: $ git pull https://github.com/andschwa/zookeeper ZOOKEEPER-2756 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zookeeper/pull/255.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #255 ---- commit 932ca61b3f7d3112b5368872a4bfec7523484ee2 Author: Andrew Schwartzmeyer <and...@schwartzmeyer.com> Date: 2017-04-10T23:12:40Z ZOOKEEPER-2756: Add CMake build system for better cross-platform support This notably lacks Solaris and libtool support. Almost everything else from Autotools has been ported, including header/function/library checks, and all targets (zookeeper, hashtable, cli, load_gen, and tests). Both Linux and Windows are supported. The primary work involved (other than the writing of `CMakeLists.txt`) was transitioning the hand-written `winconfig.h` to an auto-generated `config.h` file, and guarding code with `#ifdef HAVE_FEATURE`. The `cmake_config.h.in` template was modeled after the Autotools config file so that the feature guards share the same names. While `load_gen.c` looks at first glance as if it were ported to Windows, it never actually was, so the erroneous `#include "win32port.h"` was removed, and the target is not built on Windows. There are existent warnings which this patch did not attempt to fix, save a few easy ones (set but unused `rc` variable). Fix DLL_EXPORT and USE_STATIC_LIB redefinition. Some changes to `winconfig.h` necessary to build with Visual Studio 2015 (and 2017) were included; these originally came from a patch embedded inside the Mesos build process. ---- > Add CMake build system for better cross-platform support > -------------------------------------------------------- > > Key: ZOOKEEPER-2756 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2756 > Project: ZooKeeper > Issue Type: Improvement > Components: build, c client > Affects Versions: 3.5.2 > Environment: Windows and Linux > Reporter: Andrew Schwartzmeyer > Assignee: Andrew Schwartzmeyer > Labels: build, windows > Attachments: ZOOKEEPER-2756.patch > > > The C bindings primary build system is Autotools. This obviously does not > work for Windows, and so the original port to Windows simply added a Visual > Studio solution to the project, splitting the build system. As new versions > of Visual Studio have come along, new (probably auto-converted) solutions > have come along (see zookeeper.sln vs zookeeper-vs2013.sln). When Mesos > started being ported to Windows, a Visual Studio 2015 solution was needed, > and the previous developer created yet another solution, and setup Mesos' > build to patch ZooKeeper and add the 2015 solution. Now Visual Studio 2017 > was released, and in the process of moving Mesos ahead, I realized that I > would either have to make *yet another* converted solution for ZooKeeper. So > instead I tackled the root problem, and ported the Autotools build to CMake, > which is a meta-build system which generates files for the in-use platform > (whether it be Linux or Solaris or MacOS or Windows). > NOTE: I already have this patch, and will submit it. It has a couple TODOs, > and some other things in it that were necessary for Mesos that may need to be > pulled into separate patches. -- This message was sent by Atlassian JIRA (v6.3.15#6346)