1
- # Copyright (c) 2015, 2018 , Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2015, 2019 , Oracle and/or its affiliates. All rights reserved.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
- # it under the terms of the GNU General Public License, version 2.0, as
5
- # published by the Free Software Foundation.
4
+ # it under the terms of the GNU General Public License, version 2.0,
5
+ # as published by the Free Software Foundation.
6
6
#
7
7
# This program is also distributed with certain software (including
8
8
# but not limited to OpenSSL) that is licensed under separate terms,
9
9
# as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
11
- # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
10
+ # documentation. The authors of MySQL hereby grant you an additional
11
+ # permission to link the program and your derivative works with the
12
+ # separately licensed software that they have included with MySQL.
14
13
#
15
- # Without limiting anything contained in the foregoing, this file,
16
- # which is part of MySQL Connector/C++, is also subject to the
17
- # Universal FOSS Exception, version 1.0, a copy of which can be found at
18
- # http://oss.oracle.com/licenses/universal-foss-exception.
19
- #
20
- # This program is distributed in the hope that it will be useful, but
21
- # WITHOUT ANY WARRANTY; without even the implied warranty of
22
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
- # See the GNU General Public License, version 2.0, for more details.
14
+ # This program is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # GNU General Public License, version 2.0, for more details.
24
18
#
25
19
# You should have received a copy of the GNU General Public License
26
- # along with this program; if not, write to the Free Software Foundation, Inc.,
27
- # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
-
29
- # The files in protobuf-2.6.1/ are unmodified versions of google source files.
30
- # To save some space and time, we have remove directories which are not
31
- # needed by MySQL:
32
- # protobuf-2.6.1/gtest/
33
- # protobuf-2.6.1/java/
34
- # protobuf-2.6.1/python/
35
- # protobuf-2.6.1/m4/
36
- # protobuf-2.6.1/vsprojects/
20
+ # along with this program; if not, write to the Free Software
21
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
+
23
+ # The files in protobuf-3.6.1/ are almost unmodified versions of google
24
+ # source files taken from protobuf-cpp-3.6.1.tar.gz archive.
25
+ # Changes:
26
+ # - remove directories and files
27
+ # protobuf-3.6.1/benchmarks/
28
+ # protobuf-3.6.1/conformance/
29
+ # protobuf-3.6.1/editors/
30
+ # protobuf-3.6.1/examples/
31
+ # protobuf-3.6.1/objectivec/
32
+ # protobuf-3.6.1/third_party/
33
+ # protobuf-3.6.1/python/
34
+ # protobuf-3.6.1/util/
35
+ # protobuf-3.6.1/ar-lib
36
+ # protobuf-3.6.1/test-driver
37
+ # - disable configuration check of cmake's mimimum version
38
+ # - disable configuration zlib check
39
+ # - disable installation script
40
+ # - fix minor compilation issues on SunPro 5.14.0
41
+ # - fix minor issues to satisfy UBSAN
42
+
37
43
38
44
cmake_minimum_required (VERSION 2.8 )
39
45
PROJECT (Protobuf )
@@ -168,6 +174,8 @@ if(WIN32)
168
174
/wd4800
169
175
/wd4355
170
176
/wd4267
177
+ /wd4506
178
+ /wd4146
171
179
)
172
180
173
181
endif ()
@@ -191,7 +199,7 @@ endif()
191
199
192
200
193
201
SET (PROTO_SRC_DIR
194
- "${PROJECT_SOURCE_DIR} /protobuf-2 .6.1/src" )
202
+ "${PROJECT_SOURCE_DIR} /protobuf-3 .6.1/src" )
195
203
196
204
197
205
file (WRITE "${PROJECT_BINARY_DIR} /exports.cmake"
@@ -212,12 +220,15 @@ INCLUDE_DIRECTORIES(
212
220
213
221
SET (LIBPROTOBUF_LITE_SOURCES
214
222
${PROTO_SRC_DIR} /google/protobuf/stubs/common.cc
215
- ${PROTO_SRC_DIR} /google/protobuf/stubs/once.cc
216
223
${PROTO_SRC_DIR} /google/protobuf/stubs/hash.h
224
+ ${PROTO_SRC_DIR} /google/protobuf/stubs/int128.cc
217
225
${PROTO_SRC_DIR} /google/protobuf/stubs/map_util.h
218
- ${PROTO_SRC_DIR} /google/protobuf/stubs/shared_ptr.h
226
+ ${PROTO_SRC_DIR} /google/protobuf/stubs/status.cc
227
+ ${PROTO_SRC_DIR} /google/protobuf/stubs/stringpiece.cc
219
228
${PROTO_SRC_DIR} /google/protobuf/stubs/stringprintf.cc
220
229
${PROTO_SRC_DIR} /google/protobuf/stubs/stringprintf.h
230
+ ${PROTO_SRC_DIR} /google/protobuf/stubs/structurally_valid.cc
231
+ ${PROTO_SRC_DIR} /google/protobuf/arena.cc
221
232
${PROTO_SRC_DIR} /google/protobuf/extension_set.cc
222
233
${PROTO_SRC_DIR} /google/protobuf/generated_message_util.cc
223
234
${PROTO_SRC_DIR} /google/protobuf/message_lite.cc
@@ -227,40 +238,29 @@ SET(LIBPROTOBUF_LITE_SOURCES
227
238
${PROTO_SRC_DIR} /google/protobuf/io/coded_stream_inl.h
228
239
${PROTO_SRC_DIR} /google/protobuf/io/zero_copy_stream.cc
229
240
${PROTO_SRC_DIR} /google/protobuf/io/zero_copy_stream_impl_lite.cc
241
+ ${PROTO_SRC_DIR} /google/protobuf/implicit_weak_message.cc
230
242
)
231
243
232
- IF (MSVC )
233
-
234
- list (APPEND LIBPROTOBUF_LITE_SOURCES
235
- ${PROTO_SRC_DIR} /google/protobuf/stubs/atomicops_internals_x86_msvc.cc )
236
-
237
- ELSEIF (NOT APPLE )
238
-
239
- # Platforms such as FreeBSD require this file even though we build with clang
240
- # Only on OSX the file is not used (and generates empty object file compiler
241
- # warnings)
242
-
243
- list (APPEND LIBPROTOBUF_LITE_SOURCES
244
- ${PROTO_SRC_DIR} /google/protobuf/stubs/atomicops_internals_x86_gcc.cc )
245
-
246
- ENDIF ()
247
-
248
244
ADD_LIBRARY (protobuf-lite STATIC ${LIBPROTOBUF_LITE_SOURCES} )
249
245
SET_PROPERTY (TARGET protobuf-lite PROPERTY EXCLUDE_FROM_ALL TRUE )
250
246
pb_export (protobuf-lite )
251
247
252
248
SET (LIBPROTOBUF_SOURCES
249
+ ${PROTO_SRC_DIR} /google/protobuf/any.cc
250
+
253
251
${PROTO_SRC_DIR} /google/protobuf/stubs/strutil.cc
254
252
${PROTO_SRC_DIR} /google/protobuf/stubs/strutil.h
255
253
${PROTO_SRC_DIR} /google/protobuf/stubs/substitute.cc
256
254
${PROTO_SRC_DIR} /google/protobuf/stubs/substitute.h
255
+
257
256
${PROTO_SRC_DIR} /google/protobuf/stubs/structurally_valid.cc
258
257
${PROTO_SRC_DIR} /google/protobuf/descriptor.cc
259
258
${PROTO_SRC_DIR} /google/protobuf/descriptor.pb.cc
260
259
${PROTO_SRC_DIR} /google/protobuf/descriptor_database.cc
261
260
${PROTO_SRC_DIR} /google/protobuf/dynamic_message.cc
262
261
${PROTO_SRC_DIR} /google/protobuf/extension_set_heavy.cc
263
262
${PROTO_SRC_DIR} /google/protobuf/generated_message_reflection.cc
263
+ ${PROTO_SRC_DIR} /google/protobuf/map_field.cc
264
264
${PROTO_SRC_DIR} /google/protobuf/message.cc
265
265
${PROTO_SRC_DIR} /google/protobuf/reflection_ops.cc
266
266
${PROTO_SRC_DIR} /google/protobuf/service.cc
@@ -271,6 +271,8 @@ SET(LIBPROTOBUF_SOURCES
271
271
${PROTO_SRC_DIR} /google/protobuf/io/strtod.cc
272
272
${PROTO_SRC_DIR} /google/protobuf/io/tokenizer.cc
273
273
${PROTO_SRC_DIR} /google/protobuf/io/zero_copy_stream_impl.cc
274
+ ${PROTO_SRC_DIR} /google/protobuf/compiler/cpp/cpp_map_field.cc
275
+ ${PROTO_SRC_DIR} /google/protobuf/compiler/cpp/cpp_padding_optimizer.cc
274
276
${PROTO_SRC_DIR} /google/protobuf/compiler/importer.cc
275
277
${PROTO_SRC_DIR} /google/protobuf/compiler/parser.cc
276
278
)
@@ -319,12 +321,14 @@ SET(LIBPROTOC_SOURCES
319
321
${PROTO_SRC_DIR} /google/protobuf/compiler/cpp/cpp_service.h
320
322
${PROTO_SRC_DIR} /google/protobuf/compiler/cpp/cpp_string_field.cc
321
323
${PROTO_SRC_DIR} /google/protobuf/compiler/cpp/cpp_string_field.h
324
+ ${PROTO_SRC_DIR} /google/protobuf/stubs/io_win32.cc
322
325
)
323
326
324
327
ADD_LIBRARY (protoclib STATIC ${LIBPROTOC_SOURCES} )
325
328
TARGET_LINK_LIBRARIES (protoclib protobuf )
326
329
327
330
ADD_EXECUTABLE (protoc ${PROTO_SRC_DIR} /google/protobuf/compiler/main.cc )
331
+ TARGET_COMPILE_DEFINITIONS (protoc PRIVATE OPENSOURCE_PROTOBUF_CPP_BOOTSTRAP )
328
332
TARGET_LINK_LIBRARIES (protoc protoclib )
329
333
330
334
pb_export (protoc )
0 commit comments