You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/building.txt
+79-85Lines changed: 79 additions & 85 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,14 @@ To build Connector/C++, the following tools and libraries are required:
11
11
12
12
- CMake 2.8.12 or later.
13
13
14
+
- Boost 1.59 or later if the version of the C++ standard library used does
15
+
not implement the UTF8 converter (`codecvt_utf8`). Boost is also required
16
+
when building the legacy connector (see below).
17
+
14
18
- OpenSSL version 1.0.x if connector is built with OpenSSL.
15
19
16
-
@note: On some platforms Boost libraries are needed to build the connector.
17
-
Boost version 1.59.
20
+
- MySQL 8.0 client library if building the legacy connector (see below).
21
+
18
22
19
23
Build configuration
20
24
-------------------
@@ -25,54 +29,30 @@ Only out-of-source builds are supported. To configure a build, execute
25
29
$ cmake <Connector/C++ source location>
26
30
~~~~~~~
27
31
28
-
If Boost libraries are used and `cmake` can not find the required Boost
29
-
version, or if it is installed in a non-standard location, specify the
32
+
If Boost libraries are required and `cmake` can not find them, specify the
30
33
correct location using the option:
31
34
32
35
- `-DWITH_BOOST=<Boost location>`
33
36
34
-
To specify the installation location (see below), use the option:
35
-
36
-
- `-DCMAKE_INSTALL_PREFIX=<Install location>`
37
-
38
-
If not specified, the install location defaults to
39
-
`/usr/local/mysql/connector-c++-8.0`
40
-
(`<User home>/MySQL/"MySQL Connector C++ 8.0"` on Windows).
41
-
42
37
By default a shared library is built. To build a static library, use the option:
43
38
44
39
- `-DBUILD_STATIC=yes`
45
40
46
-
Building of the legacy C++ JDBC4 library
47
-
----------------------------------------
48
-
Connector/C++ supports the legacy C++ JDBC4 API, which is placed inside a
49
-
separate library `libmysqlcppconn` or `mysqlcppconn` depending on the Operating
50
-
System.
41
+
The build system generated by `cmake` has install target which, by default, installs to `/usr/local/mysql/connector-c++-8.0`
42
+
(`<User home>/MySQL/"MySQL Connector C++ 8.0"` on Windows). To change this default install location use the option:
51
43
52
-
In order to enable building of the legacy C++ JDBC4 library the Connector/C++
53
-
needs to be built with the following options:
54
-
55
-
- `WITH_JDBC` to enable the legacy C++ JDBC4 API. Usage of this option in cmake
56
-
command looks like this: `-DWITH_JDBC=yes`. By default this option is not
57
-
enabled and the legacty C++ JDBC4 functionality is not built.
58
-
59
-
- `MYSQL_DIR` to allow using server libraries such as libmysqlclient if it is
60
-
not installed at the default location.
61
-
The command line should look like: `-DMYSQL_DIR=<path_to_mysql_server_dir>`
62
-
63
-
- `WITH_BOOST` to point to boost location if it is different from the default.
64
-
The command line should look like: `-DMYSQL_DIR=<path_to_mysql_server_dir>`
44
+
- `-DCMAKE_INSTALL_PREFIX=<Install location>`
65
45
66
46
67
47
Configuring SSL libraries
68
48
-------------------------
69
49
Connector/C++ can be built with different SSL libraries.
70
-
Use `-DWITH_SSL=<Option value>' to specify the desired SSL build type:
50
+
Use `-DWITH_SSL=<Option value>` to specify the desired SSL build type:
71
51
72
-
- bundled - build with bundled YaSSL code
73
-
- system - build with external openSSL library installed on the system, the
52
+
- `bundled` - build with bundled YaSSL code (the default)
53
+
- `system` - build with external openSSL library installed on the system, the
74
54
library location is detected by cmake.
75
-
- <path> - build with external openSSL library installed at specified
55
+
- `<path>` - build with external openSSL library installed at specified
76
56
location.
77
57
78
58
@note when Connector/C++ is configured to be built to use OpenSSL it will make
@@ -83,6 +63,7 @@ Use `-DWITH_SSL=<Option value>' to specify the desired SSL build type:
83
63
it means adding -lssl -lcrypto to the compile/link command.
84
64
In Windows this is handled automatically.
85
65
66
+
86
67
Building and testing
87
68
--------------------
88
69
A build can be started with the following cmake invocation in the build
@@ -106,16 +87,10 @@ the Connector/C++ shared library:
106
87
107
88
- `libmysqlcppconn8.so.1` on Unix
108
89
- `libmysqlcppconn8.1.dylib` on OS X
109
-
- `CCC/mysqlcppconn8-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
90
+
- `CCC/mysqlcppconn8-1-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
110
91
depends on the MSVC version used to build the connector
111
-
112
-
If Connector/C++ is built to support the legacy C++ JDBC4 API (WITH_JDBC option
113
-
enabled) the build library directory will have another shared library:
114
92
115
-
- `libmysqlcppconn.so.7` on Unix
116
-
- `libmysqlcppconn.7.dylib` on OS X
117
-
- `CCC/mysqlcppconn-7-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
118
-
depends on the MSVC version used to build the connector
93
+
The number 1 in the library name is the major ABI version of the library. It is part of the library name so that different versions of the library can be used at the same time on a single system.
119
94
120
95
On Unix and OS X also appropriate symbolic links are created. On Windows the
121
96
import library for the DLL is created at `CCC/mysqlcppconn8.lib` (the `CCC/`
@@ -124,15 +99,8 @@ subdirectory is named the same as the build configuration used).
124
99
In the case of a static library build, the output library names are:
125
100
126
101
- `libmysqlcppconn8-static.a` on Unix and OS X
127
-
- `CCC/mysqlcppconn8-static.lib` and `CCC/mysqlcppconn8-static-mt.lib`
128
-
on Windows
129
-
130
-
If Connector/C++ is built to support the legacy C++ JDBC4 API (WITH_JDBC option
131
-
enabled) the build library directory will have another static library:
132
-
133
-
- `libmysqlcppconn-static.a` on Unix and OS X
134
-
- `CCC/mysqlcppconn-static.lib` and `CCC/mysqlcppconn-static-mt.lib`
135
-
on Windows
102
+
- `CCC/mysqlcppconn8-static.lib` or `CCC/mysqlcppconn8-static-mt.lib`
103
+
on Windows (see [Windows Notes] (@ref win_notes)).
0 commit comments