summaryrefslogtreecommitdiff
path: root/gyp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-01-26 18:24:36 +0100
committerKonstantin Käfer <mail@kkaefer.com>2015-02-04 10:49:08 +0100
commit3d51e116a84ee168975bcee8377e9156f77e2731 (patch)
tree5a9799423e496c8c77f3e2edd6ae334dbf823da4 /gyp
parent46553ff00c15414f4087ba9195fed7eba340fc13 (diff)
downloadqtlocation-mapboxgl-3d51e116a84ee168975bcee8377e9156f77e2731.tar.gz
use fake linker for merging the standalone static library
Diffstat (limited to 'gyp')
-rw-r--r--gyp/common.gypi2
-rwxr-xr-xgyp/link.py34
-rw-r--r--gyp/mbgl-core.gypi59
-rw-r--r--gyp/mbgl-standalone.gypi16
4 files changed, 58 insertions, 53 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi
index f16bfb27d5..2e47dd2f60 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -98,7 +98,7 @@
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3',
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
- 'DEAD_CODE_STRIPPING': 'YES',
+ 'DEAD_CODE_STRIPPING': 'NO',
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO'
}
},
diff --git a/gyp/link.py b/gyp/link.py
new file mode 100755
index 0000000000..cab61aa9e6
--- /dev/null
+++ b/gyp/link.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import sys
+from merge_static_libs import MergeLibs
+
+args = sys.argv[1:]
+
+out_lib = ''
+in_libs = []
+flags = []
+
+i = 0
+l = len(args)
+while i < l:
+ arg = args[i]
+
+ if arg[0:2] == '-l':
+ flags.append(arg)
+ elif arg == '-arch':
+ i += 1
+ elif arg == '-framework':
+ i += 1
+ flags.append(arg + ' ' + args[i])
+ elif arg == '-o':
+ i += 1
+ out_lib = args[i]
+ elif arg[0] != '-':
+ in_libs.append(arg)
+ else:
+ print 'Ignored linker directive: ' + arg
+
+ i += 1
+
+MergeLibs(in_libs, out_lib)
diff --git a/gyp/mbgl-core.gypi b/gyp/mbgl-core.gypi
index 35a535dd5f..5e6344da1c 100644
--- a/gyp/mbgl-core.gypi
+++ b/gyp/mbgl-core.gypi
@@ -6,8 +6,8 @@
'standalone_static_library': 1,
'hard_dependency': 1,
'dependencies': [
- 'shaders',
- 'version',
+ 'shaders',
+ 'version',
],
'sources': [
@@ -21,6 +21,11 @@
'bin/style.json'
],
+ 'include_dirs': [
+ '../include',
+ '../src',
+ ],
+
'variables': {
'cflags_cc': [
'<@(uv_cflags)',
@@ -38,11 +43,6 @@
],
},
- 'include_dirs': [
- '../include',
- '../src',
- ],
-
'conditions': [
['OS == "mac"', {
'xcode_settings': {
@@ -72,50 +72,5 @@
],
},
},
-
- { 'target_name': 'mbgl-standalone',
- 'type': 'none',
- 'hard_dependency': 1,
- 'dependencies': [
- 'mbgl-core'
- ],
- 'variables': {
- 'core_lib':'<(PRODUCT_DIR)/libmbgl-core.a',
- 'standalone_lib':'<(standalone_product_dir)/libmbgl.a'
- },
- 'direct_dependent_settings': {
- 'include_dirs': [
- '../include',
- ],
- 'conditions': [
- ['OS == "mac"', {
- 'xcode_settings': {
- 'OTHER_LDFLAGS': [ '<(standalone_lib)' ],
- }
- }, {
- 'ldflags': [ '<(standalone_lib)' ],
- }]
- ],
- },
- 'actions': [
- {
- 'action_name': 'build standalone core lib',
- 'inputs': [
- '<(core_lib)'
- ],
- 'outputs': [
- '<(standalone_lib)'
- ],
- 'action': [
- './gyp/merge_static_libs.py',
- '<(standalone_lib)',
- '<@(uv_static_libs)',
- '<@(curl_static_libs)',
- '<@(sqlite3_static_libs)',
- '<(core_lib)'
- ],
- }
- ]
- }
]
}
diff --git a/gyp/mbgl-standalone.gypi b/gyp/mbgl-standalone.gypi
new file mode 100644
index 0000000000..eb38a3e8c8
--- /dev/null
+++ b/gyp/mbgl-standalone.gypi
@@ -0,0 +1,16 @@
+{
+ 'targets': [
+ { 'target_name': 'standalone',
+ 'product_name': 'libmbgl.a',
+ 'type': 'executable',
+ 'hard_dependency': 1,
+
+ 'dependencies': [
+ '<(core_library)',
+ '<(platform_library)',
+ '<(storage_library)',
+ '<(headless_library)',
+ ],
+ },
+ ],
+} \ No newline at end of file