diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-01-23 16:31:48 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-02-04 10:49:07 +0100 |
commit | 272fa8935ed1e97a7c8a5e6cbd44bb47ac7dc00b (patch) | |
tree | 50b5747dd57680acadb4ab45ad52e075553ec11e /gyp | |
parent | fbe30e04c48353a9fdd14151728e27ffe168c9ca (diff) | |
download | qtlocation-mapboxgl-272fa8935ed1e97a7c8a5e6cbd44bb47ac7dc00b.tar.gz |
make storage lib separate so we can build without storage libs
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/common.gypi | 43 | ||||
-rw-r--r-- | gyp/install.gypi | 10 | ||||
-rw-r--r-- | gyp/mbgl-core.gypi | 56 | ||||
-rw-r--r-- | gyp/mbgl-headless.gypi | 5 | ||||
-rw-r--r-- | gyp/mbgl-ios.gypi | 39 | ||||
-rw-r--r-- | gyp/mbgl-linux.gypi | 63 | ||||
-rw-r--r-- | gyp/mbgl-osx.gypi | 40 | ||||
-rw-r--r-- | gyp/mbgl-platform.gypi | 20 | ||||
-rw-r--r-- | gyp/mbgl-storage-cocoa.gypi | 62 | ||||
-rw-r--r-- | gyp/mbgl-storage-curl.gypi | 68 |
10 files changed, 295 insertions, 111 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi index 3d3bddb67f..3a2024415f 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -1,19 +1,47 @@ { 'variables': { 'install_prefix%': '', - 'standalone_product_dir':'<!@(pwd)/build' + 'standalone_product_dir':'<!@(pwd)/build', + 'core_library%': 'mbgl-core', + 'headless_library%': 'mbgl-headless', }, + 'conditions': [ + ['platform == "osx"', { + 'variables': { + 'platform_library%': 'mbgl-osx', + 'storage_library%': 'mbgl-storage-cocoa', + }, + }], + ['platform == "ios"', { + 'variables': { + 'platform_library%': 'mbgl-ios', + 'storage_library%': 'mbgl-storage-cocoa', + }, + }], + ['platform == "linux"', { + 'variables': { + 'platform_library%': 'mbgl-linux', + 'storage_library%': 'mbgl-storage-curl', + }, + }], + ['platform == "android"', { + 'variables': { + 'platform_library%': 'mbgl-android', + 'storage_library%': 'mbgl-storage-curl', + }, + }], + ], 'target_defaults': { 'default_configuration': 'Release', 'conditions': [ ['OS=="mac"', { 'xcode_settings': { - 'MACOSX_DEPLOYMENT_TARGET':'10.9', + 'MACOSX_DEPLOYMENT_TARGET': '10.9', 'CLANG_CXX_LIBRARY': 'libc++', - 'CLANG_CXX_LANGUAGE_STANDARD':'c++11', + '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', + 'GCC_ENABLE_CPP_RTTI': 'YES', 'OTHER_CPLUSPLUSFLAGS': [ '-Werror', '-Wall', @@ -38,6 +66,7 @@ ['OS=="mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '-fPIC' ], + 'SKIP_INSTALL': 'YES', }, }, { 'cflags_cc': [ '-fPIC' ], @@ -46,14 +75,10 @@ 'xcode_settings': { 'SDKROOT': 'iphoneos', 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', - 'CLANG_CXX_LIBRARY': 'libc++', - 'CLANG_CXX_LANGUAGE_STANDARD':'c++11', - 'IPHONEOS_DEPLOYMENT_TARGET':'7.0', + 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', 'TARGETED_DEVICE_FAMILY': '1,2', 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', - 'CLANG_ENABLE_OBJC_ARC': 'NO', 'CODE_SIGN_IDENTITY': 'iPhone Developer', - 'SKIP_INSTALL': 'YES' }, 'configurations': { 'Release': { diff --git a/gyp/install.gypi b/gyp/install.gypi index 1c5066a9c0..48a7a997db 100644 --- a/gyp/install.gypi +++ b/gyp/install.gypi @@ -6,16 +6,18 @@ 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'mbgl-core', + '<(core_library)', + '<(headless_library)', + '<(platform_library)', + '<(storage_library)', 'mbgl-standalone', - 'mbgl-headless', - 'mbgl-<(platform)', ], 'copies': [ { 'files': [ '<(standalone_product_dir)/libmbgl.a' ], 'destination': '<(install_prefix)/lib' }, { 'files': [ '<(PRODUCT_DIR)/libmbgl-core.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': [ '<(PRODUCT_DIR)/lib<(platform_library).a' ], 'destination': '<(install_prefix)/lib' }, + { 'files': [ '<(PRODUCT_DIR)/lib<(storage_library).a' ], 'destination': '<(install_prefix)/lib' }, { 'files': [ '../include/mbgl' ], 'destination': '<(install_prefix)/include' }, ], 'variables': { diff --git a/gyp/mbgl-core.gypi b/gyp/mbgl-core.gypi index aa30c5b4dd..cf33b4ae1e 100644 --- a/gyp/mbgl-core.gypi +++ b/gyp/mbgl-core.gypi @@ -9,18 +9,9 @@ 'shaders', 'version', ], - 'variables': { - 'cflags_cc': [ - '<@(uv_cflags)', - '<@(sqlite3_cflags)', - '<@(zlib_cflags)', - '-I<(boost_root)/include', - ], - 'cflags': [ - '<@(uv_cflags)','-fPIC' - ], - }, + 'sources': [ + '<!@(find src -name "*.hpp")', '<!@(find src -name "*.cpp")', '<!@(find src -name "*.c")', '<!@(find src -name "*.h")', @@ -29,25 +20,60 @@ '<!@(find src -name "*.glsl")', 'bin/style.json' ], + + 'variables': { + 'cflags_cc': [ + '<@(uv_cflags)', + '-I<(boost_root)/include', + ], + 'cflags': [ + '<@(uv_cflags)', + '-fPIC' + ], + 'ldflags': [ + '<@(uv_ldflags)', + ], + 'libraries': [ + '<@(uv_static_libs)', + ], + }, + 'include_dirs': [ '../include', '../src', ], + 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], 'OTHER_CFLAGS': [ '<@(cflags)' ], - 'SKIP_INSTALL': 'YES' }, }, { 'cflags_cc': [ '<@(cflags_cc)' ], 'cflags': [ '<@(cflags)' ], }] - ] + ], + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'conditions': [ + ['OS == "mac"', { + 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } + }, { + 'ldflags': [ '<@(ldflags)' ], + }] + ], + }, + + 'direct_dependent_settings': { + 'include_dirs': [ + '../include', + ], + }, }, - { - 'target_name': 'mbgl-standalone', + + { 'target_name': 'mbgl-standalone', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ diff --git a/gyp/mbgl-headless.gypi b/gyp/mbgl-headless.gypi index a96ec24c9e..e2d4e010ce 100644 --- a/gyp/mbgl-headless.gypi +++ b/gyp/mbgl-headless.gypi @@ -8,9 +8,6 @@ 'cflags_cc': [ '<@(uv_cflags)', ], - 'cflags': [ - '<@(uv_cflags)', - ], }, 'include_dirs': [ '../include', @@ -19,11 +16,9 @@ ['OS == "mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'OTHER_CFLAGS': [ '<@(cflags)' ], } }, { 'cflags_cc': [ '<@(cflags_cc)' ], - 'cflags': [ '<@(cflags)' ], }] ], 'sources': [ diff --git a/gyp/mbgl-ios.gypi b/gyp/mbgl-ios.gypi index e6fa245890..c2a7b6ca70 100644 --- a/gyp/mbgl-ios.gypi +++ b/gyp/mbgl-ios.gypi @@ -8,34 +8,47 @@ 'dependencies': [ 'version', ], + 'sources': [ '../platform/darwin/log_nslog.mm', '../platform/darwin/string_nsstring.mm', - '../platform/darwin/http_request_cocoa.mm', '../platform/darwin/application_root.mm', '../platform/darwin/image.mm', - '../platform/default/asset_request_libuv.cpp', ], + + 'variables': { + 'cflags_cc': [ + '<@(uv_cflags)', + '-I<(boost_root)/include', + ], + 'libraries': [ + '<@(uv_static_libs)', + ], + 'ldflags': [ + '-framework ImageIO', + '-framework MobileCoreServices', + ], + }, + 'include_dirs': [ '../include', - '../src', ], + 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ - '<@(uv_cflags)', - '-I<(boost_root)/include', - ], + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], }, + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '<@(ldflags)' ], + }, + }, + 'direct_dependent_settings': { 'include_dirs': [ '../include', ], - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-framework ImageIO', - '-framework MobileCoreServices', - ], - }, }, }, ], diff --git a/gyp/mbgl-linux.gypi b/gyp/mbgl-linux.gypi index ae873c5a9e..85fc4a5127 100644 --- a/gyp/mbgl-linux.gypi +++ b/gyp/mbgl-linux.gypi @@ -8,19 +8,27 @@ 'dependencies': [ 'version', ], + + 'sources': [ + '../platform/default/log_stderr.cpp', + '../platform/default/string_stdlib.cpp', + '../platform/default/http_request_curl.cpp', + '../platform/default/asset_request_libuv.cpp', + '../platform/default/application_root.cpp', + '../platform/default/image.cpp', + '../platform/default/image_reader.cpp', + '../platform/default/png_reader.cpp', + '../platform/default/jpeg_reader.cpp', + ], + 'variables': { 'cflags_cc': [ '<@(png_cflags)', '<@(jpeg_cflags)', '<@(uv_cflags)', - '<@(curl_cflags)', '<@(nu_cflags)', '-I<(boost_root)/include', ], - 'cflags': [ - '<@(uv_cflags)', - '<@(nu_cflags)', - ], 'ldflags': [ '<@(png_ldflags)', '<@(jpeg_ldflags)', @@ -28,54 +36,45 @@ '<@(curl_ldflags)', '<@(nu_ldflags)', ], - }, - 'sources': [ - '../platform/default/log_stderr.cpp', - '../platform/default/string_stdlib.cpp', - '../platform/default/http_request_curl.cpp', - '../platform/default/asset_request_libuv.cpp', - '../platform/default/application_root.cpp', - '../platform/default/image.cpp', - '../platform/default/image_reader.cpp', - '../platform/default/png_reader.cpp', - '../platform/default/jpeg_reader.cpp', - ], - 'include_dirs': [ - '../include', - '../src', - ], - 'link_settings': { 'libraries': [ '<@(png_static_libs)', '<@(jpeg_static_libs)', - '<@(nu_static_libs)' + '<@(uv_static_libs)', + '<@(nu_static_libs)', ], }, + + 'include_dirs': [ + '../include', + '../src', + ], + 'conditions': [ ['OS == "mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'OTHER_CFLAGS': [ '<@(cflags)' ], } }, { 'cflags_cc': [ '<@(cflags_cc)' ], - 'cflags': [ '<@(cflags)' ], }] ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../include', - ], + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], 'conditions': [ ['OS == "mac"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - } + 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } }, { 'ldflags': [ '<@(ldflags)' ], }] ], }, + + 'direct_dependent_settings': { + 'include_dirs': [ + '../include', + ], + }, }, ], } diff --git a/gyp/mbgl-osx.gypi b/gyp/mbgl-osx.gypi index 352a132a06..d90d88ef43 100644 --- a/gyp/mbgl-osx.gypi +++ b/gyp/mbgl-osx.gypi @@ -8,35 +8,49 @@ 'dependencies': [ 'version', ], + 'sources': [ '../platform/darwin/log_nslog.mm', '../platform/darwin/string_nsstring.mm', - '../platform/darwin/http_request_cocoa.mm', '../platform/darwin/application_root.mm', '../platform/darwin/image.mm', - '../platform/default/asset_request_libuv.cpp', ], + + 'variables': { + 'cflags_cc': [ + '<@(uv_cflags)', + '-I<(boost_root)/include', + ], + 'libraries': [ + '<@(uv_static_libs)', + ], + 'ldflags': [ + '-framework Foundation', + '-framework ImageIO', + '-framework CoreServices', + ], + }, + 'include_dirs': [ '../include', '../src', ], + 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ - '<@(uv_cflags)', - '-I<(boost_root)/include', - ], + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], }, + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '<@(ldflags)' ], + }, + }, + 'direct_dependent_settings': { 'include_dirs': [ '../include', ], - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-framework Foundation', - '-framework ImageIO', - '-framework CoreServices', - ], - }, }, }, ], diff --git a/gyp/mbgl-platform.gypi b/gyp/mbgl-platform.gypi deleted file mode 100644 index 08fa5f821c..0000000000 --- a/gyp/mbgl-platform.gypi +++ /dev/null @@ -1,20 +0,0 @@ -{ - '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' }, - }], - ['platform == "android"', { - 'includes': ['mbgl-android.gypi'], - 'variables': { 'platform_library': 'mbgl-android' }, - }], - ], -} diff --git a/gyp/mbgl-storage-cocoa.gypi b/gyp/mbgl-storage-cocoa.gypi new file mode 100644 index 0000000000..c22216b823 --- /dev/null +++ b/gyp/mbgl-storage-cocoa.gypi @@ -0,0 +1,62 @@ +{ + 'targets': [ + { 'target_name': 'mbgl-storage-cocoa', + 'product_name': 'mbgl-storage-cocoa', + 'type': 'static_library', + 'standalone_static_library': 1, + 'hard_dependency': 1, + + 'sources': [ + '../platform/default/default_file_source.cpp', + '../platform/default/sqlite_cache.cpp', + '../platform/darwin/http_request_cocoa.mm', + '../platform/default/asset_request_libuv.cpp', + '../platform/default/sqlite3.hpp', + '../platform/default/sqlite3.cpp', + '../platform/default/compression.hpp', + '../platform/default/compression.cpp', + ], + + 'include_dirs': [ + '../include', + ], + + 'variables': { + 'cflags_cc': [ + '<@(uv_cflags)', + '<@(sqlite3_cflags)', + '-I<(boost_root)/include', + ], + 'ldflags': [ + '-framework Foundation', # For NSURLRequest + '<@(uv_ldflags)', + '<@(sqlite3_ldflags)', + '<@(zlib_ldflags)', + ], + 'libraries': [ + '<@(uv_static_libs)', + '<@(sqlite3_static_libs)', + '<@(zlib_static_libs)', + ], + }, + + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], + 'CLANG_ENABLE_OBJC_ARC': 'NO', + }, + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '<@(ldflags)' ], + }, + }, + + 'direct_dependent_settings': { + 'include_dirs': [ + '../include', + ], + }, + }, + ], +} diff --git a/gyp/mbgl-storage-curl.gypi b/gyp/mbgl-storage-curl.gypi new file mode 100644 index 0000000000..c47f2232dd --- /dev/null +++ b/gyp/mbgl-storage-curl.gypi @@ -0,0 +1,68 @@ +{ + 'targets': [ + { 'target_name': 'mbgl-storage-curl', + 'product_name': 'mbgl-storage-curl', + 'type': 'static_library', + 'standalone_static_library': 1, + 'hard_dependency': 1, + + 'sources': [ + '../platform/default/default_file_source.cpp', + '../platform/default/sqlite_cache.cpp', + '../platform/default/http_request_curl.cpp', + '../platform/default/asset_request_libuv.cpp', + '../platform/default/sqlite3.hpp', + '../platform/default/sqlite3.cpp', + '../platform/default/compression.hpp', + '../platform/default/compression.cpp', + ], + + 'include_dirs': [ + '../include', + ], + + 'variables': { + 'cflags_cc': [ + '<@(uv_cflags)', + '<@(sqlite3_cflags)', + '-I<(boost_root)/include', + ], + 'ldflags': [ + '<@(uv_ldflags)', + '<@(sqlite3_ldflags)', + '<@(zlib_ldflags)', + ], + 'libraries': [ + '<@(uv_static_libs)', + '<@(sqlite3_static_libs)', + '<@(zlib_static_libs)', + ], + }, + + 'conditions': [ + ['OS == "mac"', { + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], + }, + }, { + 'cflags_cc': [ '<@(cflags_cc)' ], + }], + ], + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'conditions': [ + ['OS == "mac"', { + 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } + }, { + 'ldflags': [ '<@(ldflags)' ], + }] + ], + }, + + 'direct_dependent_settings': { + 'include_dirs': [ '../include' ], + }, + }, + ], +} |