Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit fd50420

Browse files
Compile static libraries for externals using '-fPIC' on Linux
1 parent a1ecbd7 commit fd50420

File tree

6 files changed

+33
-2
lines changed

6 files changed

+33
-2
lines changed

config/configurations.gypi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
{
44
'variables':
55
{
6-
'server_mode': 0,
6+
'server_mode': 0, # Target being built for a server deployment
7+
'library_for_module': 0, # Static library will be included in a dynamic lib
78
},
89

910
'configurations':

config/linux.gypi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,20 @@
1818
[
1919
'../thirdparty/headers/linux/include',
2020
],
21+
22+
# Static libraries that are to be included into dynamic libraries
23+
# need to be compiled with the correct compilation flags
24+
'target_conditions':
25+
[
26+
[
27+
'_type == "loadable_module" or (_type == "static_library" and library_for_module != 0)',
28+
{
29+
'cflags':
30+
[
31+
'-fPIC',
32+
],
33+
},
34+
],
35+
],
2136
},
2237
}

libcore/libcore.gyp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
'target_name': 'libCore',
1212
'type': 'static_library',
1313

14+
'variables':
15+
{
16+
'library_for_module': 1,
17+
},
18+
1419
'include_dirs':
1520
[
1621
'include',

libexternal/libexternal.gyp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
'target_name': 'libExternal',
1111
'type': 'static_library',
1212

13+
'variables':
14+
{
15+
'library_for_module': 1,
16+
},
17+
1318
'include_dirs':
1419
[
1520
'include',

libexternalv1/libexternalv1.gyp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
'target_name': 'libExternalV1',
1111
'type': 'static_library',
1212

13+
'variables':
14+
{
15+
'library_for_module': 1,
16+
},
17+
1318
'include_dirs':
1419
[
1520
'include',

thirdparty

0 commit comments

Comments
 (0)