summaryrefslogtreecommitdiff
path: root/binding.gyp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-03 15:16:49 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-07 18:01:02 -0700
commitf964e40e7e9220d08751d8607af61ac5a7c0794c (patch)
treed34ca5407188fe3d71396faa8a8acceb52d9bd4b /binding.gyp
parentf5d66f362272db034a311d2077dbdb2937c9bbdf (diff)
downloadqtlocation-mapboxgl-f964e40e7e9220d08751d8607af61ac5a7c0794c.tar.gz
[build] Refactor and simplify build system
* Main gyp files are now standardized as platform/<platform>/platform.gyp. * Each platform gyp file defines appropriate loop_lib and headless_lib variables. * Each platform gyp file includes mbgl.gypi, which defines base targets which may be useful to all platforms. * CI targets are consistent across platforms: `make $(PLATFORM) && make test-$(PLATFORM)`. * Renamed the "linux" test app to "glfw". It's now built in OS X CI. * Android build flakiness is fixed. * iOS CI builds the bench and iosapp targets. * Mesa version is now in one place. * CI scripts use bash "strict mode" and correct error handling. * All build output goes to the build directory. * Removed vestigial iOS/OS X/Android Travis scripts.
Diffstat (limited to 'binding.gyp')
-rw-r--r--binding.gyp74
1 files changed, 67 insertions, 7 deletions
diff --git a/binding.gyp b/binding.gyp
index 6cf0d1cd6f..10ed677ba3 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -1,18 +1,30 @@
{
+ 'variables': {
+ 'loop_lib': 'uv',
+ 'headless_lib': 'glx',
+ },
+ 'conditions': [
+ ['OS == "mac"', {
+ 'variables': {
+ 'headless_lib': 'cgl',
+ }
+ }],
+ ],
'includes': [
- 'gyp/common.gypi',
+ 'mbgl.gypi',
],
'targets': [
- { 'target_name': '<(module_name)',
+ {
+ 'target_name': '<(module_name)',
'dependencies': [
- 'gyp/mbgl.gyp:core',
- 'gyp/mbgl.gyp:platform-<(platform_lib)',
- 'gyp/mbgl.gyp:headless-<(headless_lib)',
+ 'core',
],
'include_dirs': [
'<(node_root_dir)/include/node',
"<!(node -e \"require('nan')\")",
+ 'include',
+ 'src', # TODO: eliminate
],
'sources': [
@@ -25,9 +37,57 @@
'platform/node/src/node_request.cpp',
'platform/node/src/util/async_queue.hpp',
],
- },
- { 'target_name': 'action_after_build',
+ 'conditions': [
+ ['OS == "mac"', {
+ 'sources': [
+ 'platform/darwin/src/log_nslog.mm',
+ 'platform/darwin/src/string_nsstring.mm',
+ 'platform/darwin/src/image.mm',
+ 'platform/darwin/src/nsthread.mm',
+ ]
+ }, {
+ 'sources': [
+ 'platform/default/log_stderr.cpp',
+ 'platform/default/string_stdlib.cpp',
+ 'platform/default/thread.cpp',
+ 'platform/default/image.cpp',
+ 'platform/default/webp_reader.cpp',
+ 'platform/default/png_reader.cpp',
+ 'platform/default/jpeg_reader.cpp',
+ ],
+
+ 'cflags_cc': [
+ '<@(boost_cflags)',
+ '<@(nunicode_cflags)',
+ '<@(webp_cflags)',
+ '<@(libpng_cflags)',
+ '<@(libjpeg-turbo_cflags)',
+ ],
+
+ 'link_settings': {
+ 'libraries': [
+ '<@(nunicode_ldflags)',
+ '<@(nunicode_static_libs)',
+ '<@(webp_ldflags)',
+ '<@(webp_static_libs)',
+ '<@(libpng_ldflags)',
+ '<@(libpng_static_libs)',
+ '<@(libjpeg-turbo_ldflags)',
+ '<@(libjpeg-turbo_static_libs)',
+ ],
+ },
+ }]
+ ],
+
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS':[
+ '-Wl,-bind_at_load'
+ ],
+ },
+ },
+ {
+ 'target_name': 'action_after_build',
'type': 'none',
'dependencies': [ '<(module_name)' ],
'copies': [