PSA: Static libraries are now built as pre-GN migration.

327 views
Skip to first unread message

Henrik Kjellander

unread,
Sep 29, 2016, 4:06:26 PM9/29/16
to discuss-webrtc
There have been several questions regarding the way static libraries are built after migrating from GYP to GN. The behavior from the GYP days has been restored as of ee99696592ecc147af74243dcf1709a39ca7f744 (#14403) so everyone linking natively with WebRTC as a static library should be able to use that again.

We're also considering providing a "complete static lib" (https://bugs.webrtc.org/6418) but that seems harder to do right now, so it'll have to wait until further cleanup and refactorings are done (https://bugs.webrtc.org/5716).

Bernhard Höckner

unread,
Oct 4, 2016, 2:25:54 AM10/4/16
to discuss-webrtc
Hi,

i'm a bit confused by the log entry with ee99696592ecc147af74243dcf1709a39ca7f744 and your statement of "We're also considering providing a "complete static lib" (https://bugs.webrtc.org/6418) but that seems harder to do right now, so it'll have to wait until further cleanup and refactorings are done (https://bugs.webrtc.org/5716)."

So should i be able to get one big webrtc.lib with ee99696592ecc147af74243dcf1709a39ca7f744? because i'm working under windows and i do not see this behaviour. i also tried adding "complete_static_lib = true" but it seems as the dependencies are not added to the webrtc.lib.

Henrik Kjellander

unread,
Oct 4, 2016, 2:50:25 AM10/4/16
to discuss-webrtc
On Tue, Oct 4, 2016 at 8:25 AM, Bernhard Höckner <bhoe...@vizrt.com> wrote:
Hi,

i'm a bit confused by the log entry with ee99696592ecc147af74243dcf1709a39ca7f744 and your statement of "We're also considering providing a "complete static lib" (https://bugs.webrtc.org/6418) but that seems harder to do right now, so it'll have to wait until further cleanup and refactorings are done (https://bugs.webrtc.org/5716)."

So should i be able to get one big webrtc.lib with ee99696592ecc147af74243dcf1709a39ca7f744? because i'm working under windows and i do not see this behaviour. i also tried adding "complete_static_lib = true" but it seems as the dependencies are not added to the webrtc.lib.

No, as I said we'd like to provide such an option but it has other technical difficulties that I'm unable to prioritize right now, see https://bugs.webrtc.org/6418. If anyone else wants to work on this, I'm happy to review patches.
 


On Thursday, September 29, 2016 at 10:06:26 PM UTC+2, Henrik Kjellander wrote:
There have been several questions regarding the way static libraries are built after migrating from GYP to GN. The behavior from the GYP days has been restored as of ee99696592ecc147af74243dcf1709a39ca7f744 (#14403) so everyone linking natively with WebRTC as a static library should be able to use that again.

We're also considering providing a "complete static lib" (https://bugs.webrtc.org/6418) but that seems harder to do right now, so it'll have to wait until further cleanup and refactorings are done (https://bugs.webrtc.org/5716).

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4f20e789-9e43-45b1-b460-120a613f193d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bernhard Höckner

unread,
Oct 4, 2016, 5:46:34 AM10/4/16
to discuss-webrtc
OK, what i tried to do was to generate every rtc_static_library with complete_static_lib = true (set within the template for rtc_static_library in webrtc\build\webrtc.gni), this looks like it was not working.

Setting complete_static_lib = true within the template and setting complete_static_lib in the webrtc target (in webrtc/BUILD.gn) also didn't work - only linked protobuf stuff.

But setting complete_static_lib _only_ in webrtc/BUILD.gn works (note im working on win10/vs140):

diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index a97d508..77a62f0 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -242,6 +242,7 @@ config("common_objc") {
 
 if (!is_ios || !build_with_chromium) {
   rtc_static_library("webrtc") {
+    complete_static_lib = true
     sources = [
       # TODO(kjellander): Remove this whenever possible. GN's static_library
       # target type requires at least one object to avoid errors linking.

This produces one big static .lib, additionally i had to link metric_default.lib and field_trial_default.lib and jsoncpp.lib.




On Thursday, September 29, 2016 at 10:06:26 PM UTC+2, Henrik Kjellander wrote:

azar...@gmail.com

unread,
Mar 20, 2017, 1:31:40 PM3/20/17
to discuss-webrtc
Is there anything like complete_static_lib = true but for shared libraries? e.g. complete_shared_lib = true
Also, is there a way to break the library into smaller independent ones? There seems to be hard dependency on many libraries that otherwise are not needed by many applications

Ehsan

Alexandre GOUAILLARD

unread,
Mar 20, 2017, 7:00:11 PM3/20/17
to discuss...@googlegroups.com
On Tue, Mar 21, 2017 at 1:31 AM, <azar...@gmail.com> wrote:
Is there anything like complete_static_lib = true but for shared libraries? e.g. complete_shared_lib = true

 

Also, is there a way to break the library into smaller independent ones?

set complete_static_lib to false, or use mac (where it's done by default).
 
There seems to be hard dependency on many libraries that otherwise are not needed by many applications

Ehsan

On Thursday, September 29, 2016 at 1:06:26 PM UTC-7, Henrik Kjellander wrote:
There have been several questions regarding the way static libraries are built after migrating from GYP to GN. The behavior from the GYP days has been restored as of ee99696592ecc147af74243dcf1709a39ca7f744 (#14403) so everyone linking natively with WebRTC as a static library should be able to use that again.

We're also considering providing a "complete static lib" (https://bugs.webrtc.org/6418) but that seems harder to do right now, so it'll have to wait until further cleanup and refactorings are done (https://bugs.webrtc.org/5716).

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages