Skip to content

Commit

Permalink
Bug 1551129 - Enable --static build on windows, r=kevinjacobs
Browse files Browse the repository at this point in the history
Summary:
Refinements for static building and linking.

Reviewers: KevinJacobs

Reviewed By: KevinJacobs

Bug #: 1551129

Differential Revision: https://phabricator.services.mozilla.com/D30853

--HG--
extra : rebase_source : 1dc71765d8e4a82014af98207341b3a42f9b3078
  • Loading branch information
martinthomson committed May 16, 2019
1 parent 5664284 commit 44c5fae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 4 additions & 6 deletions coreconf/config.gypi
Expand Up @@ -150,11 +150,6 @@
'NSS_NO_INIT_SUPPORT',
],
}],
[ 'static_libs==1', {
'variables': {
'standalone_static_library': '1',
},
}],
[ 'OS!="android" and OS!="mac" and OS!="ios" and OS!="win"', {
'libraries': [
'-lpthread',
Expand Down Expand Up @@ -231,7 +226,7 @@
'product_dir': '<(nss_dist_obj_dir)/lib'
}, '_type=="executable"', {
'product_dir': '<(nss_dist_obj_dir)/bin'
}, '_standalone_static_library==1', {
}, 'static_libs==1 or _standalone_static_library==1', {
'product_dir': '<(nss_dist_obj_dir)/lib'
}],
# mapfile handling
Expand Down Expand Up @@ -322,6 +317,9 @@
},
},
}],
[ '_type=="static_library" and static_libs==1', {
'standalone_static_library': 1,
}],
],
'default_configuration': 'Debug',
'configurations': {
Expand Down
7 changes: 7 additions & 0 deletions gtests/common/gtest.gypi
Expand Up @@ -21,6 +21,13 @@
'libraries': [
'-lws2_32',
],
'conditions': [
['static_libs==1', {
'libraries': [
'-ladvapi32',
],
}],
],
}],
['OS=="android"', {
'libraries': [
Expand Down
4 changes: 0 additions & 4 deletions gtests/common/gtests.cc
@@ -1,6 +1,5 @@
#include "nspr.h"
#include "nss.h"
#include "ssl.h"

#include <cstdlib>

Expand Down Expand Up @@ -29,9 +28,6 @@ int main(int argc, char **argv) {
if (NSS_Initialize(workdir, "", "", SECMOD_DB, flags) != SECSuccess) {
return 1;
}
if (NSS_SetDomesticPolicy() != SECSuccess) {
return 1;
}
int rv = RUN_ALL_TESTS();

if (NSS_Shutdown() != SECSuccess) {
Expand Down
2 changes: 1 addition & 1 deletion lib/freebl/freebl_base.gypi
Expand Up @@ -99,7 +99,7 @@
}],
[ 'OS=="win"', {
'libraries': [
'advapi32.lib',
'-ladvapi32',
],
'conditions': [
[ 'cc_use_gnu_ld!=1 and target_arch=="x64"', {
Expand Down

0 comments on commit 44c5fae

Please sign in to comment.