Skip to content

Commit 380e398

Browse files
committed
Problem: draft build not enabled for git repo
cppzmq does not follow other zeromq projects where draft builds are enabled by default for git repository. Solution: revert back code where ENABLE_DRAFTS in set to ON if .git directory exists
1 parent 7023764 commit 380e398

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ matrix:
1616
- os: osx
1717
osx_image: xcode9.1
1818
compiler: clang
19-
env: DRAFT=1
19+
env: ENABLE_DRAFTS=ON
2020

2121
##########################################################
2222
# GCC on Linux
@@ -50,7 +50,7 @@ matrix:
5050
packages:
5151
- g++-7
5252
env:
53-
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" DRAFT=1
53+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" ENABLE_DRAFTS=ON
5454
# - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=/usr/local/clang-5.0.0/bin/clang-format
5555
# os: linux
5656
# addons:

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static))
1919
message(FATAL_ERROR "ZeroMQ version not supported!")
2020
endif()
2121

22-
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
22+
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
23+
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON)
24+
else ()
25+
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
26+
endif ()
2327
if (ENABLE_DRAFTS)
2428
ADD_DEFINITIONS (-DZMQ_BUILD_DRAFT_API)
2529
set (pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")

ci_build.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,13 @@ set -x
44
set -e
55

66
BUILD_TYPE=${BUILD_TYPE:-cmake}
7+
ZMQ_VERSION=${ZMQ_VERSION:-4.2.5}
8+
ENABLE_DRAFTS=${ENABLE_DRAFTS:-OFF}
79
LIBZMQ=${PWD}/libzmq-build
810
CPPZMQ=${PWD}/cppzmq-build
9-
ZMQ_VERSION="4.2.5"
10-
DRAFT=${DRAFT:-0}
1111
# Travis machines have 2 cores
1212
JOBS=2
1313

14-
if [ "${DRAFT}" = "1" ] ; then
15-
# if we enable drafts during the libzmq cmake build, the pkgconfig
16-
# data should set ZMQ_BUILD_DRAFT_API in dependent builds, but this
17-
# does not appear to work (TODO)
18-
export ZEROMQ_CMAKE_FLAGS="-DENABLE_DRAFTS=ON"
19-
fi
20-
2114
libzmq_install() {
2215
curl -L https://github.com/zeromq/libzmq/archive/v"${ZMQ_VERSION}".tar.gz \
2316
>zeromq.tar.gz
@@ -26,7 +19,7 @@ libzmq_install() {
2619
cmake -Hlibzmq-${ZMQ_VERSION} -B${LIBZMQ} -DWITH_PERF_TOOL=OFF \
2720
-DZMQ_BUILD_TESTS=OFF \
2821
-DCMAKE_BUILD_TYPE=Release \
29-
${ZEROMQ_CMAKE_FLAGS}
22+
-DENABLE_DRAFTS=${ENABLE_DRAFTS}
3023
cmake --build ${LIBZMQ} -- -j${JOBS}
3124
elif [ "${BUILD_TYPE}" = "pkgconfig" ] ; then
3225
pushd .
@@ -46,7 +39,7 @@ cppzmq_build() {
4639
if [ "${BUILD_TYPE}" = "cmake" ] ; then
4740
export ZeroMQ_DIR=${LIBZMQ}
4841
fi
49-
cmake -H. -B${CPPZMQ} ${ZEROMQ_CMAKE_FLAGS}
42+
cmake -H. -B${CPPZMQ} -DENABLE_DRAFTS=${ENABLE_DRAFTS}
5043
cmake --build ${CPPZMQ} -- -j${JOBS}
5144
popd
5245
}

0 commit comments

Comments
 (0)