blob: 32026850afa1803b10a9235ffe67083a1b2e0617 [file] [log] [blame]
bsalomonde7bbab2016-03-03 15:43:03 -08001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Builds shaderc for the Vulkan backend
7{
8 'variables': {
bsalomon41dc3d62016-03-04 13:38:26 -08009 'variables': { # This is the dreaded nested variables dict so that we can
10 # have dependent variables
bsalomon09e127b2016-04-13 08:02:42 -070011 'shaderc_build_configuration': '<(CONFIGURATION_NAME)',
bsalomon41dc3d62016-03-04 13:38:26 -080012 'conditions': [
bsalomon41dc3d62016-03-04 13:38:26 -080013 [ 'skia_os == "win"', {
14 'shaderc_lib_name' : 'shaderc_combined.lib',
15 }, {
16 'shaderc_lib_name' : 'libshaderc_combined.a',
17 }],
18 [ 'skia_os == "win"', {
19 'conditions': [
20 [ 'MSVS_VERSION == "2013"', {
21 'shaderc_project_type' : 'MSVS2013',
22 }],
23 [ 'MSVS_VERSION == "2015"', {
24 'shaderc_project_type' : 'MSVS2015',
25 }],
26 ],
27 }, {
28 'shaderc_project_type' : 'ninja',
29 }],
30 ],
djsollen12d62a72016-04-21 07:59:44 -070031 'shaderc_out_path': '<(PRODUCT_DIR)/shaderc_out_<(skia_arch_type)',
bsalomon41dc3d62016-03-04 13:38:26 -080032 },
33 # Export out of nested variables.
34 'shaderc_build_configuration': '<(shaderc_build_configuration)',
35 'shaderc_project_type': '<(shaderc_project_type)',
36 'shaderc_out_path': '<(shaderc_out_path)',
37 'shaderc_lib_name': '<(shaderc_lib_name)',
djsollen12d62a72016-04-21 07:59:44 -070038 'android_toolchain%': '',
bsalomon41dc3d62016-03-04 13:38:26 -080039
40 # On Windows the library winds up inside a 'Debug' or 'Release' dir, not so
41 # with ninja project build.
bsalomonde7bbab2016-03-03 15:43:03 -080042 'conditions': [
bsalomonde7bbab2016-03-03 15:43:03 -080043 [ 'skia_os == "win"', {
bsalomon41dc3d62016-03-04 13:38:26 -080044 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_build_configuration)/<(shaderc_lib_name)',
bsalomonde7bbab2016-03-03 15:43:03 -080045 }, {
bsalomon41dc3d62016-03-04 13:38:26 -080046 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_lib_name)',
bsalomonde7bbab2016-03-03 15:43:03 -080047 }],
bsalomon41dc3d62016-03-04 13:38:26 -080048 ]
bsalomonde7bbab2016-03-03 15:43:03 -080049 },
50 'targets': [
51 {
52 # Call out to a python script to build shaderc_combined and then copy it
53 # to out/<Configuration>
54 'target_name': 'shaderc_combined',
55 'type': 'none',
56 'actions': [
57 {
58 'action_name': 'compile_shaderc',
59 'inputs': [
60 '<!@(python find.py ../third_party/externals/shaderc2 "*")',
61 '../tools/build_shaderc.py',
62 ],
63 'outputs': [
bsalomon41dc3d62016-03-04 13:38:26 -080064 '<(shaderc_lib_full_path)',
bsalomonde7bbab2016-03-03 15:43:03 -080065 ],
djsollen12d62a72016-04-21 07:59:44 -070066 '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)'],
bsalomonde7bbab2016-03-03 15:43:03 -080067 },
68 ],
69 'copies': [
70 {
djsollen12d62a72016-04-21 07:59:44 -070071 'destination': '<(PRODUCT_DIR)',
bsalomon41dc3d62016-03-04 13:38:26 -080072 'files': ['<(shaderc_lib_full_path)'],
bsalomonde7bbab2016-03-03 15:43:03 -080073 },
74 ],
75 'all_dependent_settings': {
76 'link_settings': {
77 'libraries': [
bsalomon41dc3d62016-03-04 13:38:26 -080078 '<(shaderc_lib_name)',
bsalomonde7bbab2016-03-03 15:43:03 -080079 ],
80 },
81 },
82 },
83 ],
84}