Commit Graph

369 Commits

Author SHA1 Message Date
Deanna Garcia
193da6c8a9 Merge release branch 21.x into main 2022-05-13 18:07:04 +00:00
boscosiu
f91b078abf
Add endian.h to includes list
Client code is breaking due to missing include.  (endian.h was added in 9e09343 but didn't make it into this list, so it wasn't getting installed)
2022-05-10 18:40:36 -07:00
Protobuf Team
d259bd3287 Updating version.json and repo version numbers to: 21.0-rc1 2022-05-10 11:34:07 -07:00
Esun Kim
b6ee841d7c Added cmake abseil include guard 2022-05-06 15:09:13 -07:00
Adam Cozzette
f744bddb63 Sync from Piper @446575720
PROTOBUF_SYNC_PIPER
2022-05-04 23:10:09 +00:00
Adam Cozzette
5eafa23c98
Update CHANGES.txt (#9897) 2022-05-03 10:26:36 -07:00
Adam Cozzette
ec91c0e929 Sync from Piper @446048300
PROTOBUF_SYNC_PIPER
2022-05-02 22:49:53 +00:00
David L. Jones
7d48c4accd
Add forwarding lang_generator.h headers for cpp, java, and python. (#9883)
These filenames stutter, but are still being used by some users. So, these forward to the correct header. They should eventually be deprecated and removed.
2022-04-29 12:14:16 -07:00
David L. Jones
c4ddd84918
Factor out MSVC-only version.rc logic, and ensure other variables are always initialized (#9880) 2022-04-28 15:17:51 -07:00
David L. Jones
4e5e8d325a
Specify full path to proto files. (#9881)
This makes proto path handling more uniform with other source files.
2022-04-28 14:01:34 -07:00
Adam Cozzette
860f8ad171
Remove the JavaScript implementation (#9874)
This implementation is about to be split out into a separate Git repo.
2022-04-28 12:08:26 -07:00
Jonathan Ringer
c80808ce1d
Fix cmake install targets (#9822)
* Avoid exporting build tree targets to installation directory

`export(TARGETS ...)` is meant to allow for build trees to be found
from other projects, however, writing the file to an installation
directory causes buildtree paths to be hardcoded in the installed
protobuf-targets.cmake

* Install protobuf-targets.cmake from target, not build tree

This allows for installation prefixes to match the intended
installation directories, instead of being copied from
the build tree.
2022-04-20 18:38:43 -07:00
mkruskal-google
e9246cd789
Update CMake configuration to add a dependency on Abseil (#9793)
* Proof of concept for CMake Abseil dependency

* Hooked up Abseil linking

* Adding test binaries

* Reverting absl::string view use added for testing.  This will still be broken for automake and bazel

* Adding new cmake config to dist list

* Whitespace fixes and an attempt at fix for Windows Python Release (CMake version < 3.13)

* Hook up LTS to windows cmake

* Fix 'git cd' typo

* Adding clarifying comment for fix

* Adding abseil dependency to protobuf-lite too

* Update submodules instead of cloning abseil-cpp

* Adding explicit pointer to abseil root directory

Co-authored-by: Jason Lunn <jason.lunn@gmail.com>
Co-authored-by: Jorg Brown <jorg.brown@gmail.com>
2022-04-17 22:28:01 -04:00
David L. Jones
119f7d7dab Merge tag 'refs/tags/sync-piper' into sync-stage 2022-04-14 17:36:14 -07:00
David L. Jones
9e09343a49 Sync from Piper @441896533
PROTOBUF_SYNC_PIPER
2022-04-14 17:36:14 -07:00
noahdietz
5abf802bc2 Replace master with main in URLs & docs 2022-04-12 10:25:08 -07:00
Mike Kruskal
701650b7d0 Merge tag 'refs/tags/sync-piper' into sync-stage
# Conflicts:
#	csharp/src/Google.Protobuf.Test/testprotos.pb
2022-04-04 13:50:21 -07:00
Mike Kruskal
a29e0e3f44 Sync from Piper @439400376
PROTOBUF_SYNC_PIPER
2022-04-04 13:42:37 -07:00
David L. Jones
5b2c7b8373
[CMake] Declare remaining tests, and add a test output option. (#9705)
The new option will allow us to generate test XML output.

CTest can discover tests from googletest, but it generates one file
per case. We have several thousand cases, so one file each would be
far from optimal. The approach in this change will generate one file
per test (executable).
2022-03-30 13:44:42 -07:00
David L. Jones
a3347c27a3
Factor out test libraries in the cmake build. (#9689)
This change adds separate libraries for common test utilities and test proto definitions, which are shared by different test targets.

Without this change, cmake fails when generating Xcode files with the error:

```
CMake Error in CMakeLists.txt:
  The custom command generating

    .../protobuf/src/google/protobuf/unittest_lite.pb.cc

  is attached to multiple targets:

    tests
    lite-test
    lite-arena-test

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".
```
2022-03-29 11:48:16 -07:00
David L. Jones
b012ef28b9 Regenerate cmake file lists. 2022-03-23 18:10:27 -07:00
David L. Jones
40db3dabf0 Sync from Piper @436871048
PROTOBUF_SYNC_PIPER
2022-03-23 17:36:26 -07:00
Arfrever Frehtes Taifersar Arahesis
5dab09408c
Enable GeneratedDescriptorTest.EnormousDescriptor test for GCC/Clang CMake builds (#9617) 2022-03-10 16:40:07 -08:00
Arfrever Frehtes Taifersar Arahesis
bd935e101d
cmake: Call get_filename_component() with DIRECTORY mode instead of PATH mode (#9614)
PATH mode is legacy alias for DIRECTORY mode (needed only for CMake <= 2.8.11):
https://cmake.org/cmake/help/latest/command/get_filename_component.html
2022-03-10 12:05:27 -08:00
Adam Cozzette
1ddad63dd9 Sync from Piper @acozzette/proto_github_202203101748
PROTOBUF_SYNC_PIPER
2022-03-10 18:44:16 +00:00
Adam Cozzette
b20209f321 Sync from Piper @acozzette/proto_github_202203101748
PROTOBUF_SYNC_PIPER
2022-03-10 18:36:42 +00:00
Arfrever Frehtes Taifersar Arahesis
426866285b cmake: Replace protobuf_source_dir variable with protobuf_SOURCE_DIR variable (#9596)
protobuf_source_dir variable is no longer needed and has the same value
as protobuf_SOURCE_DIR variable, which is instance of CMake-standard
<PROJECT-NAME>_SOURCE_DIR variable:
https://cmake.org/cmake/help/latest/variable/PROJECT-NAME_SOURCE_DIR.html
2022-03-09 14:55:55 -08:00
Arfrever Frehtes Taifersar Arahesis
def70d725a Add cmake/CMakeLists.txt for compatibility (#9596) 2022-03-09 14:55:55 -08:00
Arfrever Frehtes Taifersar Arahesis
14cab5b909 Rename main cmake/CMakeLists.txt to CMakeLists.txt
Fixes: #9596
2022-03-09 14:55:55 -08:00
Arfrever
1cec803182
CMake fixes (#9595)
* Support older versions of CMake.

VERSION_GREATER_EQUAL is supported by CMake >=3.7:
https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal

target_link_options() is supported by CMake >=3.13:
https://cmake.org/cmake/help/latest/command/target_link_options.html

* Use PROTOBUF_USE_DLLS and LIBPROTOC_EXPORTS for libprotoc.so shared library

Similar change for libprotobuf.so and libprotobuf-lite.so was made
in commit 5a0887fc65.

* Make value of PROTOC_EXPORT dependent on LIBPROTOC_EXPORTS instead of LIBPROTOBUF_EXPORTS

This was probably intention, and LIBPROTOC_EXPORTS is also used above
in _MSC_VER branch.
2022-03-07 17:03:50 -08:00
Adam Cozzette
23e7cfd54a
Lower minimum CMake version to 3.5 (#9580)
We tried increasing it to 3.10, but that turned out to be too high since
gRPC still supports 3.5.1.
2022-03-04 13:13:19 -08:00
Adam Cozzette
88a18db91e Update protobuf version 2022-03-04 09:52:19 -08: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