diff options
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/common.gypi | 2 | ||||
-rwxr-xr-x | gyp/link.py | 34 | ||||
-rw-r--r-- | gyp/mbgl-core.gypi | 59 | ||||
-rw-r--r-- | gyp/mbgl-standalone.gypi | 16 |
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 |