Commit Graph

339 Commits

Author SHA1 Message Date
Adam Cozzette
0ece18cf2e Merge tag 'refs/tags/sync-piper' into sync-stage 2022-03-02 17:37:55 +00:00
Adam Cozzette
76398dab31 Sync from Piper @431959314
PROTOBUF_SYNC_PIPER
2022-03-02 17:37:55 +00:00
Arfrever
1d13b60904
cmake: Use linker version scripts (#9545)
Autotools build system already uses linker version scripts since
commit 13d165de9e.

Fixes: #6113
2022-03-01 17:06:14 -08:00
Arfrever
d0c06bcd93
cmake: Set correct sonames for libprotobuf-lite.so and libprotoc.so (#9529)
Soname was set for libprotobuf.so in commit a9cf69a0ed,
but similar changes for libprotobuf-lite.so and libprotoc.so were missed.

Fixes: #8635

Co-authored-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@GMail.Com>
2022-02-22 15:53:14 -08:00
David L. Jones
3ab97ce830 Sync from Piper @429642851
PROTOBUF_SYNC_PIPER
2022-02-18 14:02:12 -08:00
David L. Jones
1ba1d73e0d Sync from Piper @429333699
PROTOBUF_SYNC_PIPER
2022-02-17 09:53:51 -08:00
Timo Lange
4ed3941e27
[CMake] Allow custom plugin options e.g. to generate mocks (#9105)
* add plugin options

* refactored comment message

* added tabs for better readability

* removed newlines as they are not working properly

* allow PROTOC_OPTIONS and EXPORT_MACRO in parallel for protobuf_generate
2022-02-09 08:21:45 -08:00
Joshua Haberman
42e806fbf2 Merge branch 'master' into sync-stage-2 2022-02-08 18:36:24 -08:00
Florin Crișan
9ebb31726c
Add option to use external GTest in CMake (#8736)
If `-Dprotobuf_USE_EXTERNAL_GTEST=ON` is passed to CMake, it will use an external Google Test copy (i.e. by calling `find_package(GTest REQUIRED)`) rather than the one provided as a submodule.

This makes sense for larger projects that might already include Google Test and want to use a more standard CMake approach.

Also updated build instructions with this information, and more idiomatic usage.

Co-authored-by: Adam Cozzette <acozzette@google.com>
2022-02-07 20:41:29 -08:00
Florin Crișan
18c951efb1
Enable testing via CTest (#8737)
Convenience feature: enable users to test via the familiar `ctest` command rather than making the `check` target.

They would be able to use the familiar CMake pattern:
```
cmake -S source/protobuf -B build/protobuf ...
cmake --build build/protobuf
ctest --test-dir build/protobuf
cmake --install build/protobuf
```

This is a follow-up to 9f447fc9d3da93da29b8301f1a8ca57b1ea812d7
2022-02-07 17:38:38 -08:00
appledragon
5a0887fc65
for ios shared library export api visibility (#9160)
* for ios shared library export api visibility

* for shared library export api visibility

* for shared library export api visibility
2022-02-07 15:50:16 -08:00
Joshua Haberman
3ea30d8084
Merge pull request #9307 from owent-contrib/fix_9306
[CMAKE] `protobuf::libprotoc` and `protobuf::protoc` should be optional in legacy `protobuf-module.cmake` when crossing compiling.
2022-02-04 09:38:25 -08:00
deannagarcia
fa4ba87aff
Merge branch 'master' into sync-stage 2022-02-02 15:24:33 -08:00
Stephen Kennedy
8495372e1e
[cleanup] Msvc warnings (#9263)
* Fix and reenable signed/unsigned warning C4018

* Only disable unary minus warning C4146 in tests
2022-02-02 15:10:15 -08:00
JCooky
55645ca513
Add cmake option protobuf_INSTALL for installation files (#7123) 2022-02-02 08:29:25 -08:00
Joel Johnson
a9cf69a0ed
Use matching soname when building with CMake as Makefile (#9178)
This updates the CMake support to additionally symlink the soversion value
to the generated shared library when so generated. This aligns the
generated soversion with that traditionally used by the Makefile build
workflow and provides cross-compatibility irrespective of build approach
used.

The primary version of the non-symlink library retains the actual
(non-SO) project version for clarity and compatibility with
installations built using prior versions of CMake support. An example of
the net resulting symlink structures is shown below, where the most
important aspect is that the symlink matching the embedded SONAME is
present (libprotobuf.so.30 in the example case).

Makefile:

    libprotobuf.so -> libprotobuf.so.30.0.0
    libprotobuf.so.30 -> libprotobuf.so.30.0.0
    libprotobuf.so.30.0.0

CMake:

    libprotobuf.so -> libprotobuf.so.30
    libprotobuf.so.30 -> libprotobuf.so.3.19.0.0
    libprotobuf.so.3.19.0.0

Fixes: #8635
2022-02-01 15:27:56 -08:00
Deanna Garcia
b7fe12e367 Syncing from internal 2022-02-01 21:30:49 +00:00
Deanna Garcia
ab4585a695 Sync from Piper @425656941
PROTOBUF_SYNC_PIPER
2022-02-01 18:24:53 +00:00
David Geldreich
f180289c46
link with correct C runtime on MSVC (#9437)
when using CMake >= 3.15, we use CMAKE_MSVC_RUNTIME_LIBRARY
to reproduce the /MT vs /MD when protobuf_MSVC_STATIC_RUNTIME
is TRUE or FALSE
MultiThreaded is for /MT
MultiThreadedDebug is for /MTd
MultiThreadedDLL is for /MD
MultiThreadedDebugDLL is for /MDd
2022-01-24 13:17:14 -08:00
owentou
9e896e2e92
[CMAKE] protobuf::libprotoc and protobuf::protoc should be optional in legacy protobuf-module.cmake when crossing compiling. 2021-12-14 22:34:07 +08:00
Adam Cozzette
d049bce844
Remove references to HAVE_PTHREAD (#9100)
This is based on @haberman's changes in #8257. Now that we're using
std::mutex we no longer need to check whether pthreads are available, so
this commit removes references to HAVE_PTHREAD. I left the autotools
build alone, though, since we are likely to drop support for it soon
anyway.
2021-10-15 13:10:38 -07:00
Shigeo Hashimoto
25180ac9b6
Fix build failed for visual studio in multi-byte windows environments (#7235)
* Set source and executable charset to utf-8 when Visual Studio

* Remove unnecessary version check for visual studio
2021-10-14 09:45:40 -07:00
Adam Cozzette
7f79a416ff Update the file lists with ./update_file_lists.sh 2021-10-12 11:49:50 -07:00
Adam Cozzette
4ffb31e906 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-10-12 10:19:11 -07:00
Adam Cozzette
9488e2f8eb
Update cmake file lists (#9038)
I ran ./update_file_lists.sh to update these files.
2021-10-12 10:08:05 -07:00
Adam Cozzette
3afc828309 Sync from Piper @401883098
PROTOBUF_SYNC_PIPER
2021-10-08 16:45:26 -07:00
Josh Haberman
28c52fd5c4 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-09-27 19:18:42 +00:00
Josh Haberman
624d29d833 Sync from Piper @399250367
PROTOBUF_SYNC_PIPER
2021-09-27 19:18:41 +00:00
johanmoe
06c8cbea59
Fix cmake install for protoc component (#8994)
Fixes:
  * RUNTIME DESTINATION for protoc TARGET is not given a COMPONENT option
2021-09-22 14:25:29 -07:00
David L. Jones
96d983a02e
Tweak update_file_lists.sh to handle changes to Makefile.am. (#8965) 2021-09-10 19:32:15 -07:00
Joshua Haberman
018e2e7751 Merge tag 'refs/tags/sync-piper' into sync-stage
# Conflicts:
#	src/google/protobuf/descriptor.pb.cc
#	src/google/protobuf/duration.pb.cc
#	src/google/protobuf/timestamp.pb.cc
#	src/google/protobuf/type.pb.cc
#	src/google/protobuf/wrappers.pb.cc
2021-09-09 08:23:12 -07:00
Joshua Haberman
e5c570bb57 Sync from Piper @395706834
PROTOBUF_SYNC_PIPER
2021-09-09 08:21:42 -07:00
Saleem Abdulrasool
bf7a5e40a8 build: fix the support for CMake[<3.7]
The `VERSION_GREATER_EQUAL` operator was introduced in CMake 3.7.0
(released in 2016).  Use the long form of the check by splitting the
operation into two comparisons to support the older CMake.
2021-09-01 08:34:12 -07:00
Joshua Haberman
f79f956b74
Merge pull request #8851 from compnerd/msvc-runtime-library
cmake: support `MSVC_RUNTIME_LIBRARY` property
2021-08-28 13:37:36 -07:00
Adam Cozzette
4eed0dab5a Sync from Piper @392076391
PROTOBUF_SYNC_PIPER
2021-08-20 15:05:53 -07:00
Bo Yang
b9d6693545 Update BUILD and cmake files 2021-08-18 10:25:22 -07:00
Bo Yang
04fc93f4b5 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-08-18 09:25:50 -07:00
Bo Yang
509aee4b8b Sync from Piper @391414001
PROTOBUF_SYNC_PIPER
2021-08-17 17:26:34 -07:00
Adam Cozzette
2fd5c96f4d Add map_test.inc to build configs and new Kotlin files to java_EXTRA_DIST 2021-08-03 14:13:43 -07:00
Adam Cozzette
d46abc1e7e Update BUILD and cmake files and add some missing Java dependencies 2021-08-03 13:44:26 -07:00
Adam Cozzette
5d03f8c8a5 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-08-03 12:25:42 -07:00
Adam Cozzette
562fc946c7 Sync from Piper @388508285
PROTOBUF_SYNC_PIPER
2021-08-03 11:58:05 -07:00
Saleem Abdulrasool
c47adad0c3 cmake: support MSVC_RUNTIME_LIBRARY property
When using a new enough CMake (3.15+) prefer to use the
`MSVC_RUNTIME_LIBRARY` property on targets to select the runtime library
variant.  This property is automatically set to the value specified by
`CMAKE_MSVC_RUNTIME_LIBRARY`.  This property requires that the CMake
Policy 91 is set to new (see CMP0091).
2021-08-01 09:42:49 -07:00
Adam Cozzette
336ed1820a
Move field_access_listener from libprotobuf-lite to libprotobuf (#8775)
This should fix #8768. The field access listener code can't build
successfully as part of protobuf-lite because it relies on descriptors.
2021-06-28 16:07:28 -07:00
Jorge López Fueyo
1ae531d73b
Disabled version.rc for clang-cl (#8139) 2021-06-04 11:13:56 -07:00
Joshua Haberman
45bb1d2feb Added new file to build files. 2021-05-24 15:33:54 -07:00
Joshua Haberman
a8d8eb17df Merge tag 'refs/tags/sync-piper' into sync-stage 2021-05-24 13:49:40 -07:00
Joshua Haberman
9521803d40 Sync from Piper @375548932
PROTOBUF_SYNC_PIPER
2021-05-24 13:49:39 -07:00
Deanna Garcia
1b827fa114 Run update_file_lists.sh 2021-05-20 18:52:08 +00:00
deannagarcia
76188afb94
Merge pull request #8272 from deannagarcia/kotlinProtos
Opensourcing kotlin protos
2021-04-21 10:29:26 -07:00