2016-03-03 23:43:03 +00:00
|
|
|
# Copyright 2016 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Builds shaderc for the Vulkan backend
|
|
|
|
{
|
|
|
|
'variables': {
|
2016-03-04 21:38:26 +00:00
|
|
|
'variables': { # This is the dreaded nested variables dict so that we can
|
|
|
|
# have dependent variables
|
2016-04-13 15:02:42 +00:00
|
|
|
'shaderc_build_configuration': '<(CONFIGURATION_NAME)',
|
2016-03-04 21:38:26 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_os == "win"', {
|
|
|
|
'shaderc_lib_name' : 'shaderc_combined.lib',
|
|
|
|
}, {
|
|
|
|
'shaderc_lib_name' : 'libshaderc_combined.a',
|
|
|
|
}],
|
|
|
|
[ 'skia_os == "win"', {
|
|
|
|
'conditions': [
|
|
|
|
[ 'MSVS_VERSION == "2013"', {
|
|
|
|
'shaderc_project_type' : 'MSVS2013',
|
|
|
|
}],
|
|
|
|
[ 'MSVS_VERSION == "2015"', {
|
|
|
|
'shaderc_project_type' : 'MSVS2015',
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
'shaderc_project_type' : 'ninja',
|
|
|
|
}],
|
|
|
|
],
|
2016-04-21 14:59:44 +00:00
|
|
|
'shaderc_out_path': '<(PRODUCT_DIR)/shaderc_out_<(skia_arch_type)',
|
2016-03-04 21:38:26 +00:00
|
|
|
},
|
|
|
|
# Export out of nested variables.
|
|
|
|
'shaderc_build_configuration': '<(shaderc_build_configuration)',
|
|
|
|
'shaderc_project_type': '<(shaderc_project_type)',
|
|
|
|
'shaderc_out_path': '<(shaderc_out_path)',
|
|
|
|
'shaderc_lib_name': '<(shaderc_lib_name)',
|
2016-04-21 14:59:44 +00:00
|
|
|
'android_toolchain%': '',
|
2016-03-04 21:38:26 +00:00
|
|
|
|
|
|
|
# On Windows the library winds up inside a 'Debug' or 'Release' dir, not so
|
|
|
|
# with ninja project build.
|
2016-03-03 23:43:03 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'skia_os == "win"', {
|
2016-03-04 21:38:26 +00:00
|
|
|
'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_build_configuration)/<(shaderc_lib_name)',
|
2016-03-03 23:43:03 +00:00
|
|
|
}, {
|
2016-03-04 21:38:26 +00:00
|
|
|
'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_lib_name)',
|
2016-03-03 23:43:03 +00:00
|
|
|
}],
|
2016-03-04 21:38:26 +00:00
|
|
|
]
|
2016-03-03 23:43:03 +00:00
|
|
|
},
|
|
|
|
'targets': [
|
|
|
|
{
|
|
|
|
# Call out to a python script to build shaderc_combined and then copy it
|
|
|
|
# to out/<Configuration>
|
|
|
|
'target_name': 'shaderc_combined',
|
|
|
|
'type': 'none',
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'compile_shaderc',
|
|
|
|
'inputs': [
|
|
|
|
'<!@(python find.py ../third_party/externals/shaderc2 "*")',
|
|
|
|
'../tools/build_shaderc.py',
|
|
|
|
],
|
|
|
|
'outputs': [
|
2016-03-04 21:38:26 +00:00
|
|
|
'<(shaderc_lib_full_path)',
|
2016-03-03 23:43:03 +00:00
|
|
|
],
|
2016-04-21 14:59:44 +00:00
|
|
|
'action': ['python', '../tools/build_shaderc.py', '-s', '../third_party/externals/shaderc2', '-o', '<(shaderc_out_path)', '-a', '<(skia_arch_type)', '-t', '<(shaderc_build_configuration)', '-p', '<(shaderc_project_type)', '-c', '<(android_toolchain)'],
|
2016-03-03 23:43:03 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
'copies': [
|
|
|
|
{
|
2016-04-21 14:59:44 +00:00
|
|
|
'destination': '<(PRODUCT_DIR)',
|
2016-03-04 21:38:26 +00:00
|
|
|
'files': ['<(shaderc_lib_full_path)'],
|
2016-03-03 23:43:03 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
'all_dependent_settings': {
|
|
|
|
'link_settings': {
|
|
|
|
'libraries': [
|
2016-03-04 21:38:26 +00:00
|
|
|
'<(shaderc_lib_name)',
|
2016-03-03 23:43:03 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|