Skip to content

Commit d164080

Browse files
authored
CPP-859 - Remove vc_build.bat scripts and update building documentation (#334)
1 parent 44422c4 commit d164080

6 files changed

Lines changed: 125 additions & 3903 deletions

File tree

cpp-driver/bin/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

cpp-driver/bin/vswhere.exe

-393 KB
Binary file not shown.

cpp-driver/topics/building/README.md

Lines changed: 54 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ __NOTE__: The build procedures only need to be performed for driver development
1717
## Compatibility
1818

1919
* Architectures: 32-bit (x86) and 64-bit (x64)
20-
* Compilers: GCC 4.1.2+ Clang 3.4+, and MSVC 2010/2012/2013/2015/2017
20+
* Compilers: GCC 4.1.2+ Clang 3.4+, and MSVC 2010/2012/2013/2015/2017/2019
2121

2222
## Dependencies
2323

@@ -94,9 +94,9 @@ your system._
9494

9595
```bash
9696
pushd /tmp
97-
wget http://dist.libuv.org/dist/v1.23.0/libuv-v1.23.0.tar.gz
98-
tar xzf libuv-v1.23.0.tar.gz
99-
pushd libuv-v1.23.0
97+
wget http://dist.libuv.org/dist/v1.33.0/libuv-v1.33.0.tar.gz
98+
tar xzf libuv-v1.33.0.tar.gz
99+
pushd libuv-v1.33.0
100100
sh autogen.sh
101101
./configure
102102
make install
@@ -136,9 +136,9 @@ brew link --force openssl
136136

137137
```bash
138138
pushd /tmp
139-
wget --no-check-certificate https://www.openssl.org/source/openssl-1.0.2o.tar.gz
140-
tar xzf openssl-1.0.2o.tar.gz
141-
pushd openssl-1.0.2o
139+
wget --no-check-certificate https://www.openssl.org/source/openssl-1.0.2s.tar.gz
140+
tar xzf openssl-1.0.2s.tar.gz
141+
pushd openssl-1.0.2s
142142
CFLAGS=-fpic ./config shared
143143
make
144144
make install
@@ -182,13 +182,9 @@ cmake -DCASS_BUILD_INTEGRATION_TESTS=On ..
182182
cmake -DCASS_BUILD_UNIT_TESTS=On ..
183183
```
184184

185-
186185
## Windows
187186

188-
We provide a self-contained [batch script] for building the C/C++ driver and
189-
all of its dependencies. In order to run it, you have to install the build
190-
dependencies and clone the repository with the DataStax C/C++ driver for
191-
DataStax Enterprise.
187+
The driver is known to build with Visual Studio 2010, 2012, 2013, 2015, 2017, and 2019.
192188

193189
### Obtaining build dependencies
194190

@@ -198,76 +194,57 @@ DataStax Enterprise.
198194
* Download and install [CMake]
199195
* Make sure to select the option "Add CMake to the system PATH for all users"
200196
or "Add CMake to the system PATH for current user"
201-
* Download and install [Git]
202-
* Make sure to select the option "Use Git from Windows Command Prompt" or
203-
manually add the git executable to the system PATH.
204-
* Download and install [ActiveState Perl]
197+
* Download and install [Strawberry Perl] or [ActiveState Perl]
205198
* Make sure to select the option "Add Perl to PATH environment variable"
206-
* Download and install [Python v2.7.x][python-27]
207-
* Make sure to select/install the feature "Add python.exe to Path"
208-
* Download and install [Boost][Boost] (Optional: Tests only)
209-
* Visual Studio 2010: [32-bit][boost-msvc-100-32-bit]/[64-bit][boost-msvc-100-64-bit]
210-
* Visual Studio 2012: [32-bit][boost-msvc-110-32-bit]/[64-bit][boost-msvc-110-64-bit]
211-
* Visual Studio 2013: [32-bit][boost-msvc-120-32-bit]/[64-bit][boost-msvc-120-64-bit]
212-
* Visual Studio 2015: [32-bit][boost-msvc-140-32-bit]/[64-bit][boost-msvc-140-64-bit]
213-
* Visual Studio 2017: [32-bit][boost-msvc-141-32-bit]/[64-bit][boost-msvc-141-64-bit]
214199

215200
### Building the driver
216201

217-
The [batch script] detects installed versions of Visual Studio to simplify the
218-
build process on Windows and select the correct version of Visual Studio when
219-
compiling the driver.
220-
221-
First you will need to open a "Command Prompt" to execute the batch script.
222-
Running the batch script without any arguments will build the driver for C/C++
223-
driver for the current system architecture (e.g. x64).
224-
225-
To perform advanced build configuration, execute the batch script with the
226-
`--HELP` argument to display the options available.
227-
228-
```dos
229-
Usage: VC_BUILD.BAT [OPTION...]
230-
231-
--DEBUG Enable debug build
232-
--RELEASE Enable release build (default)
233-
--DISABLE-CLEAN Disable clean build
234-
--DEPENDENCIES-ONLY Build dependencies only
235-
--OPENSSL-VERSION OpenSSL version 1.0, 1.1 (default: 1.0)
236-
--TARGET-COMPILER [version] 141, 140, 120, 110, or 100
237-
--DISABLE-OPENSSL Disable OpenSSL support
238-
--ENABLE-EXAMPLES Enable example builds
239-
--ENABLE-PACKAGES [version] Enable package generation (*)
240-
--ENABLE-ZLIB Enable zlib
241-
--GENERATE-SOLUTION Generate Visual Studio solution (**)
242-
--INSTALL-DIR [install-dir] Override installation directory
243-
--SHARED Build shared library (default)
244-
--STATIC Build static library
245-
--ENABLE-SHARED-OPENSSL Force shared OpenSSL library
246-
--X86 Target 32-bit build (***)
247-
--X64 Target 64-bit build (***)
248-
--USE-BOOST-ATOMIC Use Boost atomic
249-
250-
Testing Arguments
251-
252-
--ENABLE-TESTS
253-
[boost-root-dir] Enable integration and unit tests build
254-
--ENABLE-INTEGRATION-TESTS
255-
[boost-root-dir] Enable integration tests build
256-
--ENABLE-UNIT-TESTS
257-
[boost-root-dir] Enable unit tests build
258-
--ENABLE-LIBSSH2 Enable libssh2 (remote server testing)
259-
260-
--HELP Display this message
261-
262-
* Packages are only generated using detected installations of Visual Studio
263-
NOTE: OpenSSL v1.0.x is used for all package builds
264-
** Dependencies are built before generation of Visual Studio solution
265-
*** Default target architecture is determined based on system architecture
202+
First you will need to open a "Command Prompt" to execute the CMake commands.
203+
204+
#### Building the C/C++ driver
205+
206+
Supported generators are:
207+
* Visual Studio 10 2010
208+
* Visual Studio 11 2012
209+
* Visual Studio 12 2013
210+
* Visual Studio 14 2015
211+
* Visual Studio 15 2017
212+
* Visual Studio 16 2019
213+
214+
```bash
215+
mkdir build
216+
pushd build
217+
cmake -G "Visual Studio 16 2019" -A x64 ..
218+
cmake --build .
219+
popd
220+
```
221+
222+
__Note__: To build 32-bit binaries/libraries use `-A Win32`.
223+
224+
#### Building examples (optional)
225+
226+
Examples are not built by default and need to be enabled. Update your [CMake]
227+
line to build examples.
228+
229+
```bash
230+
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_EXAMPLES=On ..
266231
```
267232

268-
__Note__: When overriding installation directory using `--INSTALL-DIR`, the
269-
driver dependencies will also be copied (e.g.
270-
C:\myproject\dependencies\libs)
233+
#### Building tests (optional)
234+
235+
Tests (integration and unit) are not built by default and need to be enabled.
236+
237+
##### Integration tests
238+
239+
```bash
240+
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_INTEGRATION_TESTS=On ..
241+
```
242+
243+
##### Unit tests
244+
245+
```bash
246+
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_UNIT_TESTS=On ..
247+
```
271248

272249
[download server]: http://downloads.datastax.com
273250
[cpp-driver-centos6]: http://downloads.datastax.com/cpp-driver/centos/6/cassandra
@@ -281,23 +258,10 @@ __Note__: When overriding installation directory using `--INSTALL-DIR`, the
281258
[libuv-ubuntu14-04]: http://downloads.datastax.com/cpp-driver/ubuntu/14.04/dependencies/libuv
282259
[libuv-ubuntu16-04]: http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependencies/libuv
283260
[libuv-ubuntu18-04]: http://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv
284-
[batch script]: ../../vc_build.bat
285261
[Homebrew]: https://brew.sh
286262
[Bison]: http://gnuwin32.sourceforge.net/downlinks/bison.php
287263
[CMake]: http://www.cmake.org/download
288-
[Git]: http://git-scm.com/download/win
264+
[Strawberry Perl]: http://strawberryperl.com
289265
[ActiveState Perl]: https://www.perl.org/get.html#win32
290-
[python-27]: https://www.python.org/downloads
291266
[libuv]: http://libuv.org
292267
[OpenSSL]: https://www.openssl.org
293-
[Boost]: http://www.boost.org
294-
[boost-msvc-100-32-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-10.0-32.exe/download
295-
[boost-msvc-100-64-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-10.0-64.exe/download
296-
[boost-msvc-110-32-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-11.0-32.exe/download
297-
[boost-msvc-110-64-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-11.0-64.exe/download
298-
[boost-msvc-120-32-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-12.0-32.exe/download
299-
[boost-msvc-120-64-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-12.0-64.exe/download
300-
[boost-msvc-140-32-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-14.0-32.exe/download
301-
[boost-msvc-140-64-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-14.0-64.exe/download
302-
[boost-msvc-141-32-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.68.0/boost_1_68_0-msvc-14.1-32.exe/download
303-
[boost-msvc-141-64-bit]: http://sourceforge.net/projects/boost/files/boost-binaries/1.64.0/boost_1_64_0-msvc-14.1-64.exe/download

0 commit comments

Comments
 (0)