Upstream version 8.37.183.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / angle.gypi
1 # Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6     'variables':
7     {
8         'angle_code': 1,
9         'angle_post_build_script%': 0,
10         'angle_gen_path': '<(SHARED_INTERMEDIATE_DIR)/angle',
11         'angle_id_script_base': 'commit_id.py',
12         'angle_id_script': '<(angle_gen_path)/<(angle_id_script_base)',
13         'angle_id_header_base': 'commit.h',
14         'angle_id_header': '<(angle_gen_path)/id/<(angle_id_header_base)',
15         'angle_use_commit_id%': '<!(python <(angle_id_script_base) check ..)',
16     },
17     'includes':
18     [
19         'compiler.gypi',
20         'libGLESv2.gypi',
21         'libEGL.gypi'
22     ],
23
24     'targets':
25     [
26         {
27             'target_name': 'copy_scripts',
28             'type': 'none',
29             'copies':
30             [
31                 {
32                     'destination': '<(angle_gen_path)',
33                     'files': [ 'copy_compiler_dll.bat', '<(angle_id_script_base)' ],
34                 },
35             ],
36         },
37     ],
38     'conditions':
39     [
40         ['angle_use_commit_id!=0',
41         {
42             'targets':
43             [
44                 {
45                     'target_name': 'commit_id',
46                     'type': 'none',
47                     'includes': [ '../build/common_defines.gypi', ],
48                     'dependencies': [ 'copy_scripts', ],
49                     'actions':
50                     [
51                         {
52                             'action_name': 'Generate ANGLE Commit ID Header',
53                             'message': 'Generating ANGLE Commit ID',
54                             # reference the git index as an input, so we rebuild on changes to the index
55                             'inputs': [ '<(angle_id_script)', '<(angle_path)/.git/index' ],
56                             'outputs': [ '<(angle_id_header)' ],
57                             'msvs_cygwin_shell': 0,
58                             'action':
59                             [
60                                 'python', '<(angle_id_script)', 'gen', '<(angle_path)', '<(angle_id_header)'
61                             ],
62                         },
63                     ],
64                     'direct_dependent_settings':
65                     {
66                         'include_dirs':
67                         [
68                             '<(angle_gen_path)',
69                         ],
70                     },
71                 }
72             ]
73         },
74         { # angle_use_commit_id==0
75             'targets':
76             [
77                 {
78                     'target_name': 'commit_id',
79                     'type': 'none',
80                     'copies':
81                     [
82                         {
83                             'destination': '<(angle_gen_path)/id',
84                             'files': [ '<(angle_id_header_base)' ]
85                         }
86                     ],
87                     'direct_dependent_settings':
88                     {
89                         'include_dirs':
90                         [
91                             '<(angle_gen_path)',
92                         ],
93                     },
94                 }
95             ]
96         }],
97         ['OS=="win"',
98         {
99             'targets':
100             [
101                 {
102                     'target_name': 'copy_compiler_dll',
103                     'type': 'none',
104                     'dependencies': [ 'copy_scripts', ],
105                     'includes': [ '../build/common_defines.gypi', ],
106                     'actions':
107                     [
108                         {
109                             'action_name': 'copy_dll',
110                             'message': 'Copying D3D Compiler DLL...',
111                             'msvs_cygwin_shell': 0,
112                             'inputs': [ 'copy_compiler_dll.bat' ],
113                             'outputs': [ '<(PRODUCT_DIR)/D3DCompiler_46.dll' ],
114                             'action':
115                             [
116                                 "<(angle_gen_path)/copy_compiler_dll.bat",
117                                 "$(PlatformName)",
118                                 "<(windows_sdk_path)",
119                                 "<(PRODUCT_DIR)"
120                             ],
121                         },
122                     ], #actions
123                 },
124             ], # targets
125         }],
126         ['angle_post_build_script!=0 and OS=="win"',
127         {
128             'targets':
129             [
130                 {
131                     'target_name': 'post_build',
132                     'type': 'none',
133                     'includes': [ '../build/common_defines.gypi', ],
134                     'dependencies': [ 'libGLESv2', 'libEGL' ],
135                     'actions':
136                     [
137                         {
138                             'action_name': 'ANGLE Post-Build Script',
139                             'message': 'Running <(angle_post_build_script)...',
140                             'msvs_cygwin_shell': 0,
141                             'inputs': [ '<(angle_post_build_script)', '<!@(["python", "<(angle_post_build_script)", "inputs", "<(angle_path)", "<(CONFIGURATION_NAME)", "$(PlatformName)", "<(PRODUCT_DIR)"])' ],
142                             'outputs': [ '<!@(python <(angle_post_build_script) outputs "<(angle_path)" "<(CONFIGURATION_NAME)" "$(PlatformName)" "<(PRODUCT_DIR)")' ],
143                             'action': ['python', '<(angle_post_build_script)', 'run', '<(angle_path)', '<(CONFIGURATION_NAME)', '$(PlatformName)', '<(PRODUCT_DIR)'],
144                         },
145                     ], #actions
146                 },
147             ], # targets
148         }],
149     ] # conditions
150 }