summaryrefslogtreecommitdiff
path: root/gyp
diff options
context:
space:
mode:
Diffstat (limited to 'gyp')
-rw-r--r--gyp/certificates.gypi12
-rw-r--r--gyp/common.gypi52
-rw-r--r--gyp/fixtures.gypi17
-rw-r--r--gyp/install.gypi23
-rw-r--r--gyp/mbgl-headless.gypi15
-rw-r--r--gyp/mbgl-ios.gypi58
-rw-r--r--gyp/mbgl-linux.gypi54
-rw-r--r--gyp/mbgl-osx.gypi33
-rw-r--r--gyp/mbgl-platform.gypi16
-rw-r--r--gyp/mbgl.gypi74
-rw-r--r--gyp/npm_install.gypi20
-rw-r--r--gyp/shaders.gypi36
-rw-r--r--gyp/styles.gypi36
13 files changed, 446 insertions, 0 deletions
diff --git a/gyp/certificates.gypi b/gyp/certificates.gypi
new file mode 100644
index 0000000000..1d0c2acf86
--- /dev/null
+++ b/gyp/certificates.gypi
@@ -0,0 +1,12 @@
+{
+ 'targets': [
+ { 'target_name': 'copy_certificate_bundle',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'copies': [{
+ 'files': [ '../common/ca-bundle.crt' ],
+ 'destination': '<(PRODUCT_DIR)'
+ }],
+ },
+ ]
+}
diff --git a/gyp/common.gypi b/gyp/common.gypi
new file mode 100644
index 0000000000..6d6b0e6671
--- /dev/null
+++ b/gyp/common.gypi
@@ -0,0 +1,52 @@
+{
+ 'variables': {
+ 'install_prefix%': '',
+ },
+ 'target_defaults': {
+ 'default_configuration': 'Release',
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'CLANG_CXX_LIBRARY': 'libc++',
+ 'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
+ 'GCC_ENABLE_CPP_RTTI':'YES',
+ 'OTHER_CPLUSPLUSFLAGS': [ '-Wall', '-Wextra', '-Wshadow', '-Wno-variadic-macros', '-frtti', '-fexceptions' ],
+ 'GCC_WARN_PEDANTIC': 'YES',
+ 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE',
+ },
+ }],
+ ['OS=="linux"', {
+ 'cflags_cc': [
+ '-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin.
+ '-Wno-literal-suffix', # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61653
+ ],
+ }],
+ ],
+ 'cflags_cc': [ '-std=c++11', '-Werror', '-Wall', '-Wextra', '-Wshadow', '-frtti', '-fexceptions' ],
+ 'configurations': {
+ 'Debug': {
+ 'cflags_cc': [ '-g', '-O0', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ],
+ 'defines': [ 'DEBUG' ],
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '0',
+ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
+ 'DEAD_CODE_STRIPPING': 'NO',
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO',
+ 'OTHER_CPLUSPLUSFLAGS': [ '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common']
+ }
+ },
+ 'Release': {
+ 'cflags_cc': [ '-O3' ],
+ 'defines': [ 'NDEBUG' ],
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '3',
+ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
+ 'DEAD_CODE_STRIPPING': 'YES',
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO'
+ }
+ },
+ },
+ }
+}
diff --git a/gyp/fixtures.gypi b/gyp/fixtures.gypi
new file mode 100644
index 0000000000..199865a6f3
--- /dev/null
+++ b/gyp/fixtures.gypi
@@ -0,0 +1,17 @@
+{
+ 'targets': [
+ { 'target_name': 'copy_fixtures',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [
+ 'bundle_styles'
+ ],
+ 'copies': [
+ {
+ 'files': [ '../styles' ],
+ 'destination': '../test/fixtures/style_parser'
+ }
+ ]
+ },
+ ]
+}
diff --git a/gyp/install.gypi b/gyp/install.gypi
new file mode 100644
index 0000000000..8b79a45180
--- /dev/null
+++ b/gyp/install.gypi
@@ -0,0 +1,23 @@
+{
+ 'conditions': [
+ ['install_prefix != ""', {
+ 'targets': [
+ { 'target_name': 'install',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [
+ 'mbgl',
+ 'mbgl-headless',
+ 'mbgl-<(platform)',
+ ],
+ 'copies': [
+ { 'files': [ '<(PRODUCT_DIR)/libmbgl.a' ], 'destination': '<(install_prefix)/lib' },
+ { 'files': [ '<(PRODUCT_DIR)/libmbgl-headless.a' ], 'destination': '<(install_prefix)/lib' },
+ { 'files': [ '<(PRODUCT_DIR)/libmbgl-<(platform).a' ], 'destination': '<(install_prefix)/lib' },
+ { 'files': [ '../include/mbgl' ], 'destination': '<(install_prefix)/include' }
+ ],
+ },
+ ]
+ }],
+ ],
+}
diff --git a/gyp/mbgl-headless.gypi b/gyp/mbgl-headless.gypi
new file mode 100644
index 0000000000..5ffc251d22
--- /dev/null
+++ b/gyp/mbgl-headless.gypi
@@ -0,0 +1,15 @@
+{
+ 'targets': [
+ { 'target_name': 'mbgl-headless',
+ 'product_name': 'mbgl-headless',
+ 'type': 'static_library',
+ 'include_dirs': [
+ '../include',
+ ],
+ 'sources': [
+ '../platform/default/headless_view.cpp',
+ '../platform/default/headless_display.cpp',
+ ],
+ },
+ ]
+} \ No newline at end of file
diff --git a/gyp/mbgl-ios.gypi b/gyp/mbgl-ios.gypi
new file mode 100644
index 0000000000..dbad60086c
--- /dev/null
+++ b/gyp/mbgl-ios.gypi
@@ -0,0 +1,58 @@
+{
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_type == "static_library"', {
+ 'xcode_settings': {
+ 'SDKROOT': 'iphoneos',
+ 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos',
+ 'CLANG_CXX_LIBRARY': 'libc++',
+ 'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
+ 'IPHONEOS_DEPLOYMENT_TARGET':'7.0',
+ 'TARGETED_DEVICE_FAMILY': '1,2',
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'CLANG_ENABLE_OBJC_ARC': 'YES',
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'PUBLIC_HEADERS_FOLDER_PATH': 'include',
+ },
+ 'configurations': {
+ 'Release': {
+ 'xcode_settings': {
+ 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ],
+ },
+ },
+ },
+ }],
+ ],
+ },
+ 'targets': [
+ { 'target_name': 'mbgl-ios',
+ 'product_name': 'mbgl-ios',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'include_dirs': [
+ '../include',
+ ],
+ 'sources': [
+ '../platform/ios/cache_database_library.mm',
+ '../platform/darwin/log_nslog.mm',
+ '../platform/darwin/string_nsstring.mm',
+ '../platform/darwin/http_request_baton_cocoa.mm',
+ ],
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '<@(uv_cflags)',
+ ],
+ },
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../include',
+ ],
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(uv_libraries)',
+ ],
+ },
+ },
+ },
+ ],
+}
diff --git a/gyp/mbgl-linux.gypi b/gyp/mbgl-linux.gypi
new file mode 100644
index 0000000000..39a1755569
--- /dev/null
+++ b/gyp/mbgl-linux.gypi
@@ -0,0 +1,54 @@
+{
+ 'targets': [
+ { 'target_name': 'mbgl-linux',
+ 'product_name': 'mbgl-linux',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'include_dirs': [
+ '../include'
+ ],
+ 'sources': [
+ '../platform/default/cache_database_tmp.cpp',
+ '../platform/default/log_stderr.cpp',
+ '../platform/default/string_stdlib.cpp',
+ '../platform/default/http_request_baton_curl.cpp',
+ ],
+ 'conditions': [
+ ['OS == "mac"', {
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '<@(uv_cflags)',
+ '<@(curl_cflags)',
+ ],
+ }
+ }, {
+ 'cflags': [
+ '<@(uv_cflags)',
+ '<@(curl_cflags)',
+ ],
+ }]
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../include',
+ ],
+ 'conditions': [
+ ['OS == "mac"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(uv_libraries)',
+ '<@(curl_libraries)',
+ ]
+ }
+ }, {
+ 'libraries': [
+ '<@(uv_libraries)',
+ '<@(curl_libraries)',
+ '-lboost_regex',
+ ]
+ }]
+ ]
+ }
+ },
+ ]
+}
diff --git a/gyp/mbgl-osx.gypi b/gyp/mbgl-osx.gypi
new file mode 100644
index 0000000000..ba117e5a59
--- /dev/null
+++ b/gyp/mbgl-osx.gypi
@@ -0,0 +1,33 @@
+{
+ 'targets': [
+ { 'target_name': 'mbgl-osx',
+ 'product_name': 'mbgl-osx',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'include_dirs': [
+ '../include',
+ ],
+ 'sources': [
+ '../platform/osx/cache_database_application_support.mm',
+ '../platform/darwin/log_nslog.mm',
+ '../platform/darwin/string_nsstring.mm',
+ '../platform/darwin/http_request_baton_cocoa.mm',
+ ],
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '<@(uv_cflags)',
+ ],
+ },
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../include',
+ ],
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(uv_libraries)',
+ ],
+ },
+ },
+ },
+ ],
+}
diff --git a/gyp/mbgl-platform.gypi b/gyp/mbgl-platform.gypi
new file mode 100644
index 0000000000..74ac9aecc6
--- /dev/null
+++ b/gyp/mbgl-platform.gypi
@@ -0,0 +1,16 @@
+{
+ 'conditions': [
+ ['platform == "osx"', {
+ 'includes': ['mbgl-osx.gypi'],
+ 'variables': { 'platform_library': 'mbgl-osx' },
+ }],
+ ['platform == "ios"', {
+ 'includes': ['mbgl-ios.gypi'],
+ 'variables': { 'platform_library': 'mbgl-ios' },
+ }],
+ ['platform == "linux"', {
+ 'includes': ['mbgl-linux.gypi'],
+ 'variables': { 'platform_library': 'mbgl-linux' },
+ }],
+ ],
+}
diff --git a/gyp/mbgl.gypi b/gyp/mbgl.gypi
new file mode 100644
index 0000000000..f268fd6255
--- /dev/null
+++ b/gyp/mbgl.gypi
@@ -0,0 +1,74 @@
+{
+ 'targets': [
+ { 'target_name': 'mbgl',
+ 'product_name': 'mbgl',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'dependencies': [
+ 'shaders',
+ ],
+ 'sources': [
+ '<!@(find src -name "*.cpp")',
+ '<!@(test -f "config/constants_local.cpp" && echo "config/constants_local.cpp" || echo "config/constants.cpp")',
+ '<!@(find src -name "*.c")',
+ '<!@(find src -name "*.h")',
+ '<!@(find include -name "*.hpp")',
+ '<!@(find include -name "*.h")',
+ '<!@(find src -name "*.glsl")',
+ 'bin/style.json'
+ ],
+ 'include_dirs': [
+ '../include'
+ ],
+ 'conditions': [
+ ['OS == "mac"', {
+ 'xcode_settings': {
+ 'PUBLIC_HEADERS_FOLDER_PATH': 'include',
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '<@(png_cflags)',
+ '<@(uv_cflags)',
+ '<@(sqlite3_cflags)',
+ '<@(zlib_cflags)',
+ '-I<(boost_root)/include',
+ ],
+ 'OTHER_CFLAGS': [
+ '<@(uv_cflags)',
+ ],
+ },
+ }, {
+ 'cflags': [
+ '<@(png_cflags)',
+ '<@(uv_cflags)',
+ '<@(sqlite3_cflags)',
+ '<@(zlib_cflags)',
+ '-I<(boost_root)/include',
+ ],
+ }]
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../include',
+ ],
+ 'conditions': [
+ ['OS == "mac"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(png_libraries)',
+ '<@(uv_libraries)',
+ '<@(sqlite3_libraries)',
+ '<@(zlib_libraries)',
+ ]
+ }
+ }, {
+ 'libraries': [
+ '<@(png_libraries)',
+ '<@(uv_libraries)',
+ '<@(sqlite3_libraries)',
+ '<@(zlib_libraries)',
+ ]
+ }]
+ ]
+ }
+ }
+ ]
+}
diff --git a/gyp/npm_install.gypi b/gyp/npm_install.gypi
new file mode 100644
index 0000000000..ddd3081ad5
--- /dev/null
+++ b/gyp/npm_install.gypi
@@ -0,0 +1,20 @@
+{
+ 'targets': [
+ { 'target_name': 'npm_install',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'actions': [
+ {
+ 'action_name': 'npm install',
+ 'inputs': [
+ '../bin/package.json',
+ ],
+ 'outputs': [
+ '../bin/node_modules',
+ ],
+ 'action': ['./scripts/npm_install.sh', '<@(npm)']
+ }
+ ],
+ },
+ ]
+}
diff --git a/gyp/shaders.gypi b/gyp/shaders.gypi
new file mode 100644
index 0000000000..9435bd7d9c
--- /dev/null
+++ b/gyp/shaders.gypi
@@ -0,0 +1,36 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'shaders',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [
+ 'npm_install'
+ ],
+ 'actions': [
+ {
+ 'action_name': 'Build Shaders',
+ 'inputs': [
+ '<!@(find src -name "*.glsl")'
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/mbgl/shader/shaders.hpp',
+ '<(SHARED_INTERMEDIATE_DIR)/src/shader/shaders_gl.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/src/shader/shaders_gles2.cpp',
+ ],
+ 'action': ['<@(node)', 'bin/build-shaders.js', '<(SHARED_INTERMEDIATE_DIR)'],
+ }
+ ],
+ 'direct_dependent_settings': {
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/mbgl/shader/shaders.hpp',
+ '<(SHARED_INTERMEDIATE_DIR)/src/shader/shaders_gl.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/src/shader/shaders_gles2.cpp'
+ ],
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/',
+ ]
+ }
+ },
+ ]
+}
diff --git a/gyp/styles.gypi b/gyp/styles.gypi
new file mode 100644
index 0000000000..31bf530c5f
--- /dev/null
+++ b/gyp/styles.gypi
@@ -0,0 +1,36 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'touch_styles',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'actions': [
+ {
+ 'action_name': 'Touch Stylesheet Directory',
+ 'inputs': ['../styles'],
+ 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/'], # need to specify a distinct directory
+ 'action': ['touch', '../styles'],
+ }
+ ],
+ },
+ {
+ 'target_name': 'bundle_styles',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [ 'touch_styles' ], # required for xcode http://openradar.appspot.com/7232149
+ 'direct_dependent_settings': {
+ 'mac_bundle_resources': [ '../styles' ],
+ }
+ },
+ {
+ 'target_name': 'copy_styles',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'dependencies': [ 'touch_styles' ], # required for xcode http://openradar.appspot.com/7232149
+ 'copies': [{
+ 'files': [ '../styles' ],
+ 'destination': '<(PRODUCT_DIR)'
+ }],
+ },
+ ]
+}