OLD | NEW |
1 # Copyright 2016 Google Inc. | 1 # Copyright 2016 Google Inc. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Builds shaderc for the Vulkan backend | 6 # Builds shaderc for the Vulkan backend |
7 { | 7 { |
8 'variables': { | 8 'variables': { |
| 9 'variables': { # This is the dreaded nested variables dict so that we can |
| 10 # have dependent variables |
| 11 'conditions': [ |
| 12 [ 'CONFIGURATION_NAME == "Release_Developer"', { |
| 13 'shaderc_build_configuration' : 'Release', |
| 14 }, { |
| 15 'shaderc_build_configuration' : '<(CONFIGURATION_NAME)', |
| 16 }], |
| 17 [ 'skia_os == "win"', { |
| 18 'shaderc_lib_name' : 'shaderc_combined.lib', |
| 19 }, { |
| 20 'shaderc_lib_name' : 'libshaderc_combined.a', |
| 21 }], |
| 22 [ 'skia_os == "win"', { |
| 23 'conditions': [ |
| 24 [ 'MSVS_VERSION == "2013"', { |
| 25 'shaderc_project_type' : 'MSVS2013', |
| 26 }], |
| 27 [ 'MSVS_VERSION == "2015"', { |
| 28 'shaderc_project_type' : 'MSVS2015', |
| 29 }], |
| 30 ], |
| 31 }, { |
| 32 'shaderc_project_type' : 'ninja', |
| 33 }], |
| 34 ], |
| 35 'shaderc_out_path': '../out/<(CONFIGURATION_NAME)/shaderc_out_<(skia_arch_
type)', |
| 36 }, |
| 37 # Export out of nested variables. |
| 38 'shaderc_build_configuration': '<(shaderc_build_configuration)', |
| 39 'shaderc_project_type': '<(shaderc_project_type)', |
| 40 'shaderc_out_path': '<(shaderc_out_path)', |
| 41 'shaderc_lib_name': '<(shaderc_lib_name)', |
| 42 |
| 43 # On Windows the library winds up inside a 'Debug' or 'Release' dir, not so |
| 44 # with ninja project build. |
9 'conditions': [ | 45 'conditions': [ |
10 [ 'CONFIGURATION_NAME == "Release_Developer"', { | 46 [ 'skia_os == "win"', { |
11 'shaderc_build_type' : 'Release', | 47 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_build
_configuration)/<(shaderc_lib_name)', |
12 }, { | 48 }, { |
13 'shaderc_build_type' : '<(CONFIGURATION_NAME)', | 49 'shaderc_lib_full_path': '<(shaderc_out_path)/libshaderc/<(shaderc_lib_n
ame)', |
14 }], | 50 }], |
15 [ 'skia_os == "win"', { | 51 ] |
16 'shaderc_lib_name' : 'shaderc_combined.lib', | |
17 }, { | |
18 'shaderc_lib_name' : 'libshaderc_combined.a', | |
19 }], | |
20 [ 'MSVS_VERSION == "2013"', { | |
21 'shaderc_project_type' : 'MSVS2013', | |
22 }], | |
23 [ 'MSVS_VERSION == "2015"', { | |
24 'shaderc_project_type' : 'MSVS2015', | |
25 }], | |
26 ], | |
27 'skia_build_type' : '<(CONFIGURATION_NAME)', | |
28 }, | 52 }, |
29 'targets': [ | 53 'targets': [ |
30 { | 54 { |
31 # Call out to a python script to build shaderc_combined and then copy it | 55 # Call out to a python script to build shaderc_combined and then copy it |
32 # to out/<Configuration> | 56 # to out/<Configuration> |
33 'target_name': 'shaderc_combined', | 57 'target_name': 'shaderc_combined', |
34 'type': 'none', | 58 'type': 'none', |
35 'actions': [ | 59 'actions': [ |
36 { | 60 { |
37 'action_name': 'compile_shaderc', | 61 'action_name': 'compile_shaderc', |
38 'inputs': [ | 62 'inputs': [ |
39 '<!@(python find.py ../third_party/externals/shaderc2 "*")', | 63 '<!@(python find.py ../third_party/externals/shaderc2 "*")', |
40 '../tools/build_shaderc.py', | 64 '../tools/build_shaderc.py', |
41 ], | 65 ], |
42 'outputs': [ | 66 'outputs': [ |
43 '../out/<(skia_build_type)/shaderc_out_<(skia_arch_type)/libshaderc
/<(shaderc_build_type)/<(shaderc_lib_name)', | 67 '<(shaderc_lib_full_path)', |
44 ], | 68 ], |
45 'action': ['python', '../tools/build_shaderc.py', '-s', '../third_part
y/externals/shaderc2', '-o', '../out/<(skia_build_type)/shaderc_out_<(skia_arch_
type)', '-a', '<(skia_arch_type)', '-t', '<(shaderc_build_type)', '-p', '<(shade
rc_project_type)'], | 69 'action': ['python', '../tools/build_shaderc.py', '-s', '../third_part
y/externals/shaderc2', '-o', '<(shaderc_out_path)', '-a', '<(skia_arch_type)', '
-t', '<(shaderc_build_configuration)', '-p', '<(shaderc_project_type)'], |
46 }, | 70 }, |
47 ], | 71 ], |
48 'copies': [ | 72 'copies': [ |
49 { | 73 { |
50 'destination': '../out/<(skia_build_type)', | 74 'destination': '../out/<(CONFIGURATION_NAME)', |
51 'files': ['../out/<(skia_build_type)/shaderc_out_<(skia_arch_type)/lib
shaderc/<(shaderc_build_type)/<(shaderc_lib_name)'], | 75 'files': ['<(shaderc_lib_full_path)'], |
52 }, | 76 }, |
53 ], | 77 ], |
54 'all_dependent_settings': { | 78 'all_dependent_settings': { |
55 'link_settings': { | 79 'link_settings': { |
56 'libraries': [ | 80 'libraries': [ |
57 '-lshaderc_combined', | 81 '<(shaderc_lib_name)', |
58 ], | 82 ], |
59 }, | 83 }, |
60 }, | 84 }, |
61 }, | 85 }, |
62 ], | 86 ], |
63 } | 87 } |
OLD | NEW |