bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 1 | # 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': { |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 9 | 'variables': { # This is the dreaded nested variables dict so that we can |
| 10 | # have dependent variables |
bsalomon | 09e127b | 2016-04-13 08:02:42 -0700 | [diff] [blame] | 11 | 'shaderc_build_configuration': '<(CONFIGURATION_NAME)', |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 12 | 'conditions': [ |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 13 | [ '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 | ], |
djsollen | 12d62a7 | 2016-04-21 07:59:44 -0700 | [diff] [blame] | 31 | 'shaderc_out_path': '<(PRODUCT_DIR)/shaderc_out_<(skia_arch_type)', |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 32 | }, |
| 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)', |
djsollen | 12d62a7 | 2016-04-21 07:59:44 -0700 | [diff] [blame] | 38 | 'android_toolchain%': '', |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 39 | |
| 40 | # On Windows the library winds up inside a 'Debug' or 'Release' dir, not so |
| 41 | # with ninja project build. |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 42 | 'conditions': [ |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 43 | [ 'skia_os == "win"', { |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 44 | 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_build_configuration)/<(shaderc_lib_name)', |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 45 | }, { |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 46 | 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_lib_name)', |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 47 | }], |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 48 | ] |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 49 | }, |
| 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': [ |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 64 | '<(shaderc_lib_full_path)', |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 65 | ], |
djsollen | 12d62a7 | 2016-04-21 07:59:44 -0700 | [diff] [blame] | 66 | '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)'], |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 67 | }, |
| 68 | ], |
| 69 | 'copies': [ |
| 70 | { |
djsollen | 12d62a7 | 2016-04-21 07:59:44 -0700 | [diff] [blame] | 71 | 'destination': '<(PRODUCT_DIR)', |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 72 | 'files': ['<(shaderc_lib_full_path)'], |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 73 | }, |
| 74 | ], |
| 75 | 'all_dependent_settings': { |
| 76 | 'link_settings': { |
| 77 | 'libraries': [ |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 78 | '<(shaderc_lib_name)', |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 79 | ], |
| 80 | }, |
| 81 | }, |
| 82 | }, |
| 83 | ], |
| 84 | } |