2015-03-25 17:22:41 +00:00
|
|
|
# Copyright 2015 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
2014-02-27 20:40:31 +00:00
|
|
|
# GYP for building gpu
|
2011-05-31 13:50:51 +00:00
|
|
|
{
|
2011-10-13 13:33:08 +00:00
|
|
|
'target_defaults': {
|
|
|
|
'conditions': [
|
|
|
|
['skia_os != "win"', {
|
|
|
|
'sources/': [ ['exclude', '_win.(h|cpp)$'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['skia_os != "mac"', {
|
2012-10-02 15:25:12 +00:00
|
|
|
'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'],
|
2011-10-13 13:33:08 +00:00
|
|
|
],
|
|
|
|
}],
|
2016-04-29 21:01:34 +00:00
|
|
|
['skia_os != "linux"', {
|
2014-10-01 17:52:52 +00:00
|
|
|
'sources/': [ ['exclude', '_glx.(h|cpp)$'],
|
2011-10-13 13:33:08 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
['skia_os != "ios"', {
|
2012-10-02 15:25:12 +00:00
|
|
|
'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'],
|
2011-10-13 13:33:08 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
['skia_os != "android"', {
|
|
|
|
'sources/': [ ['exclude', '_android.(h|cpp)$'],
|
|
|
|
],
|
|
|
|
}],
|
2015-04-02 19:16:36 +00:00
|
|
|
['skia_egl == 0', {
|
2014-10-01 17:52:52 +00:00
|
|
|
'sources/': [ ['exclude', '_egl.(h|cpp)$'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['skia_os == "android"', {
|
|
|
|
'sources/': [ ['exclude', 'GrGLCreateNativeInterface_egl.cpp'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['skia_egl == 1', {
|
|
|
|
'sources/': [ ['exclude', '_glx.(h|cpp)$'],
|
|
|
|
],
|
|
|
|
}],
|
2012-08-02 14:03:32 +00:00
|
|
|
# nullify the targets in this gyp file if skia_gpu is 0
|
|
|
|
[ 'skia_gpu == 0', {
|
|
|
|
'sources/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
'defines/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
'include_dirs/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
'link_settings': {
|
|
|
|
'libraries/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'defines/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
'include_dirs/': [
|
|
|
|
['exclude', '.*'],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2011-10-13 13:33:08 +00:00
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'../include/gpu',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2011-05-31 13:50:51 +00:00
|
|
|
'targets': [
|
|
|
|
{
|
2013-06-18 14:43:53 +00:00
|
|
|
'target_name': 'skgpu',
|
|
|
|
'product_name': 'skia_skgpu',
|
2011-05-31 13:50:51 +00:00
|
|
|
'type': 'static_library',
|
2012-10-10 19:45:51 +00:00
|
|
|
'standalone_static_library': 1,
|
2013-07-22 14:39:45 +00:00
|
|
|
'dependencies': [
|
|
|
|
'core.gyp:*',
|
2015-03-23 19:51:20 +00:00
|
|
|
'utils.gyp:utils',
|
2014-06-02 14:38:14 +00:00
|
|
|
'etc1.gyp:libetc1',
|
2014-06-03 20:04:35 +00:00
|
|
|
'ktx.gyp:libSkKTX',
|
2016-07-01 15:22:01 +00:00
|
|
|
'sksl.gyp:sksl',
|
2013-07-22 14:39:45 +00:00
|
|
|
],
|
2012-08-23 12:55:01 +00:00
|
|
|
'includes': [
|
|
|
|
'gpu.gypi',
|
|
|
|
],
|
2011-05-31 13:50:51 +00:00
|
|
|
'include_dirs': [
|
2013-07-20 00:24:35 +00:00
|
|
|
'../include/gpu',
|
2015-07-28 15:55:14 +00:00
|
|
|
'../include/private',
|
2013-07-22 14:39:45 +00:00
|
|
|
'../src/core',
|
2012-05-07 17:09:37 +00:00
|
|
|
'../src/gpu',
|
2014-12-11 16:20:31 +00:00
|
|
|
'../src/image/',
|
2016-07-01 15:22:01 +00:00
|
|
|
'../src/sksl',
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
|
|
|
'sources': [
|
2013-06-18 14:43:53 +00:00
|
|
|
'<@(skgpu_sources)',
|
|
|
|
'<@(skgpu_native_gl_sources)',
|
2016-02-22 20:13:19 +00:00
|
|
|
'<@(skgpu_vk_sources)',
|
2012-09-04 14:37:12 +00:00
|
|
|
'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
|
|
|
'conditions': [
|
2015-03-09 16:40:42 +00:00
|
|
|
[ 'skia_gpu_extra_dependency_path', {
|
|
|
|
'dependencies' : [
|
|
|
|
'<(skia_gpu_extra_dependency_path):*',
|
2015-08-14 15:37:50 +00:00
|
|
|
],
|
|
|
|
'export_dependent_settings': [
|
|
|
|
'<(skia_gpu_extra_dependency_path):*',
|
|
|
|
],
|
2015-03-09 16:40:42 +00:00
|
|
|
}],
|
2013-12-10 15:19:32 +00:00
|
|
|
[ 'skia_chrome_utils', {
|
|
|
|
'sources': [
|
|
|
|
'../experimental/ChromeUtils/SkBorder.cpp',
|
|
|
|
'../experimental/ChromeUtils/SkBorder.h',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
'GR_CHROME_UTILS=1',
|
|
|
|
],
|
|
|
|
}],
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os == "linux"', {
|
2011-05-31 13:50:51 +00:00
|
|
|
'sources!': [
|
2012-02-10 21:35:06 +00:00
|
|
|
'../src/gpu/gl/GrGLDefaultInterface_none.cpp',
|
|
|
|
'../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
2014-10-01 17:52:52 +00:00
|
|
|
}],
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os == "linux" and skia_egl == 1', {
|
2014-10-01 17:52:52 +00:00
|
|
|
'link_settings': {
|
|
|
|
'libraries': [
|
|
|
|
'-lEGL',
|
|
|
|
'-lGLESv2',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2016-04-29 21:01:34 +00:00
|
|
|
[ 'skia_os == "linux" and skia_egl == 0', {
|
2011-05-31 13:50:51 +00:00
|
|
|
'link_settings': {
|
|
|
|
'libraries': [
|
|
|
|
'-lGL',
|
2012-11-01 17:43:44 +00:00
|
|
|
'-lGLU',
|
2012-11-12 20:55:02 +00:00
|
|
|
'-lX11',
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2011-07-01 20:20:07 +00:00
|
|
|
[ 'skia_os == "mac"', {
|
2011-05-31 13:50:51 +00:00
|
|
|
'link_settings': {
|
|
|
|
'libraries': [
|
|
|
|
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'sources!': [
|
2012-02-10 21:35:06 +00:00
|
|
|
'../src/gpu/gl/GrGLDefaultInterface_none.cpp',
|
|
|
|
'../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
2011-10-19 20:43:20 +00:00
|
|
|
}],
|
2012-09-28 16:56:28 +00:00
|
|
|
[ 'skia_os in ["win", "ios"]', {
|
2011-05-31 13:50:51 +00:00
|
|
|
'sources!': [
|
2012-02-10 21:35:06 +00:00
|
|
|
'../src/gpu/gl/GrGLDefaultInterface_none.cpp',
|
|
|
|
'../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
|
|
|
}],
|
2011-11-03 13:08:29 +00:00
|
|
|
[ 'skia_os == "android"', {
|
|
|
|
'sources!': [
|
2012-02-10 21:35:06 +00:00
|
|
|
'../src/gpu/gl/GrGLDefaultInterface_none.cpp',
|
|
|
|
'../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
|
2011-11-03 13:08:29 +00:00
|
|
|
],
|
2014-07-10 12:10:20 +00:00
|
|
|
'defines': [
|
|
|
|
'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
|
|
|
|
],
|
2011-11-03 13:08:29 +00:00
|
|
|
'link_settings': {
|
|
|
|
'libraries': [
|
|
|
|
'-lGLESv2',
|
|
|
|
'-lEGL',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2016-02-22 20:13:19 +00:00
|
|
|
[ 'skia_vulkan', {
|
2016-07-06 16:17:35 +00:00
|
|
|
'link_settings': {
|
|
|
|
'libraries': [ '<(vulkan_lib_name)', ],
|
|
|
|
},
|
|
|
|
'dependencies': [
|
|
|
|
'shaderc.gyp:shaderc_combined',
|
|
|
|
],
|
2016-03-04 21:38:26 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_os == "win"', {
|
|
|
|
'variables': {
|
|
|
|
'vulkan_lib_name': '-lvulkan-1',
|
2016-09-06 15:40:51 +00:00
|
|
|
'vulkan_sdk_path' : '<!(echo %VULKAN_SDK%)',
|
2016-03-04 21:38:26 +00:00
|
|
|
},
|
|
|
|
'include_dirs': [
|
|
|
|
'<(vulkan_sdk_path)/Include',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'<(vulkan_sdk_path)/Include',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'link_settings': {
|
2016-03-10 20:31:20 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_arch_type == "x86"', {
|
|
|
|
'library_dirs': [ '<(vulkan_sdk_path)/Bin32', ],
|
|
|
|
}, {
|
|
|
|
'library_dirs': [ '<(vulkan_sdk_path)/Bin', ],
|
|
|
|
}],
|
|
|
|
]
|
2016-03-04 21:38:26 +00:00
|
|
|
},
|
|
|
|
}, {
|
|
|
|
'variables': {
|
|
|
|
'vulkan_lib_name': '-lvulkan',
|
|
|
|
},
|
|
|
|
}],
|
2016-06-17 19:04:05 +00:00
|
|
|
[ 'skia_os == "linux"', {
|
|
|
|
'variables': {
|
|
|
|
'vulkan_sdk_path' : '<!(echo $VULKAN_SDK)',
|
|
|
|
},
|
|
|
|
'include_dirs': [
|
|
|
|
'<(vulkan_sdk_path)/include',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'<(vulkan_sdk_path)/include',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'link_settings': {
|
|
|
|
'library_dirs': [ '<(vulkan_sdk_path)/lib', ],
|
|
|
|
},
|
|
|
|
}],
|
2016-07-06 16:17:35 +00:00
|
|
|
[ 'skia_android_framework', {
|
|
|
|
'include_dirs': [
|
|
|
|
'frameworks/native/vulkan/include',
|
|
|
|
'../tools/viewer/sk_app',
|
|
|
|
'../tools/viewer/sk_app/android',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'frameworks/native/vulkan/include',
|
|
|
|
'../tools/viewer/sk_app',
|
|
|
|
'../tools/viewer/sk_app/android',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'dependencies!': [
|
|
|
|
'shaderc.gyp:shaderc_combined',
|
|
|
|
],
|
|
|
|
'sources': [
|
|
|
|
# the gyp -> android.mk generator doesn't seem to like cpp files
|
|
|
|
# in directories outside of src, bench, or dm. Until this gets fixed
|
|
|
|
# I just start the path in the src directory.
|
2016-08-10 14:30:21 +00:00
|
|
|
'<(skia_src_path)/../tools/viewer/sk_app/WindowContext.cpp',
|
2016-07-06 16:17:35 +00:00
|
|
|
'<(skia_src_path)/../tools/viewer/sk_app/VulkanWindowContext.cpp',
|
|
|
|
'<(skia_src_path)/../tools/viewer/sk_app/android/VulkanWindowContext_android.cpp'
|
|
|
|
],
|
|
|
|
}],
|
2016-03-04 21:38:26 +00:00
|
|
|
],
|
2016-02-22 20:13:19 +00:00
|
|
|
}, {
|
|
|
|
'sources!': [
|
|
|
|
'<@(skgpu_vk_sources)',
|
|
|
|
],
|
|
|
|
}],
|
2011-05-31 13:50:51 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|