aisouard / libwebrtc

:package: Google's WebRTC implementation in a single static library.
https://axel.isouard.fr/libwebrtc
Apache License 2.0
641 stars 190 forks source link

Support webrtc release 63 #62

Open dynamiccast opened 6 years ago

dynamiccast commented 6 years ago

WARNING, this breaks backward compatibility. branch-head below 63 will not work.

Not sure how to handle this but webrtc 63 do not work with the cmake script anymore. The WebRTC team has moved all headers from out/webrtc/src/webrtc to out/webrtc/src. This commit install the header from the right location.

However, CMakeModules/Templates/LibWebRTCConfig.cmake.in has been modified to include both the INSTALL_INCLUDE_DIR and INSTALL_INCLUDE_DIR/webrtc. This is because we still want to include webRTC header this way from our program: #include <webrtc/somefile.h> but then the header from webrtc might include other webrtc header this way #include <someotherfile.h.

I'm not sure how to handle the backward compatibility and the small hack with the include. Because of this I advise not to merge this PR. Someone can still get inspiration from it to make it better though.

agouaillard commented 6 years ago

I don't know if it helps, but in our case, we started by extracting the version (branch_head) and subversion (number of commits since branch head) to use in the xxxConfigVersion.cmake. We would use cmake to create a config file that would contain the version as a C preprocessor define to be used at compilation time. It allowed for a time to have application code that would support multiple webrtc versions by using the following pattern:

if WEBRTC_VERSION < 61

include /webrtc/base/...

else if WEBRTC_VERSION < 62

include /webrtc/rtc_base/...

else if WEBRTC_VERSION < 63

include /rtc_base/...

Unfortunately, those changes in libwebrtc were not the exception but the normality and the maintenance burden was increasing too quickly. We are now using branches across, i.e. all our projects depending on libwebrtc have a 61, 62, 63, .... branch which are all in sync, and this branches contains code that is aligned with the branch_head version. Made our life easy, and simplified the maintenance A LOT !