OLD | NEW |
---|---|
(Empty) | |
1 # Copyright (c) 2013 Google Inc. 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 'pgd_basename': 'test_pgo', | |
8 }, | |
9 'targets': [ | |
10 # In the PGO (Profile-Guided Optimization) build flow, we need to build the | |
11 # target binary multiple times. To implement this flow with gyp, here we | |
12 # define multiple 'executable' targets, each of which represents one build | |
13 # particular build/profile stage. On tricky part to do this is that these | |
14 # 'executable' targets should share the code itself so taht profile data | |
scottmg
2013/11/25 15:13:39
nit; "taht"
yukawa
2013/12/03 16:10:41
Done.
| |
15 # can be reused among these 'executable' files. In other words, the only | |
16 # differences among below 'executable' targets are: | |
17 # 1) PGO (Profile-Guided Optimization) database, and | |
18 # 2) linker options. | |
19 # The following static library contains all the logic including entry point. | |
20 # Basically we don't need to rebuild this target once we enter profiling | |
21 # phase of PGO. | |
22 { | |
23 'target_name': 'test_pgo_main', | |
24 'type': 'static_library', | |
25 'msvs_settings': { | |
26 'VCCLCompilerTool': { | |
27 'WholeProgramOptimization': 'true', # /GL | |
28 }, | |
29 'VCLibrarianTool': { | |
30 'LinkTimeCodeGeneration': 'true', | |
31 }, | |
32 }, | |
33 'link_settings': { | |
34 'msvs_settings': { | |
35 'VCLinkerTool': { | |
36 'ProfileGuidedDatabase': '$(OutDir)\\<(pgd_basename).pgd', | |
37 'TargetMachine': '1', # x86 - 32 | |
38 'SubSystem': '1', # /SUBSYSTEM:CONSOLE | |
39 # We need to specify 'libcmt.lib' here so that the linker can pick | |
40 # up a valid entry point. | |
41 'AdditionalDependencies': [ | |
42 'libcmt.lib', | |
43 ], | |
44 }, | |
45 }, | |
46 }, | |
47 'sources': [ | |
48 'inline_test.h', | |
49 'inline_test.cc', | |
50 'inline_test_main.cc', | |
51 ], | |
52 }, | |
53 { | |
54 'target_name': 'test_pgo_instrument', | |
55 'type': 'executable', | |
56 'msvs_settings': { | |
57 'VCLinkerTool': { | |
58 'LinkTimeCodeGeneration': '2', | |
59 }, | |
60 }, | |
61 'dependencies': [ | |
62 'test_pgo_main', | |
63 ], | |
64 }, | |
65 { | |
66 'target_name': 'test_pgo_instrument_stub', | |
67 'type': 'none', | |
68 'dependencies': [ | |
69 'test_pgo_instrument', | |
70 ], | |
71 }, | |
72 { | |
73 'target_name': 'gen_profile_guided_database', | |
74 'type': 'none', | |
75 'msvs_cygwin_shell': 0, | |
76 'actions': [ | |
77 { | |
78 'action_name': 'action_main', | |
79 'inputs': [], | |
80 'outputs': [ | |
81 '$(OutDir)\\<(pgd_basename).pgd', | |
82 ], | |
83 'action': [ | |
84 'python', 'update_pgd.py', | |
85 '--vcbindir', '$(VCInstallDir)bin', | |
86 '--exe', '$(OutDir)\\test_pgo_instrument.exe', | |
87 '--pgd', '$(OutDir)\\<(pgd_basename).pgd', | |
88 ], | |
89 }, | |
90 ], | |
91 'dependencies': [ | |
92 'test_pgo_instrument', | |
93 ], | |
94 }, | |
95 { | |
96 'target_name': 'test_pgo_optimize', | |
97 'type': 'executable', | |
98 'msvs_settings': { | |
99 'VCLinkerTool': { | |
100 'LinkTimeCodeGeneration': '3', | |
101 }, | |
102 }, | |
103 'sources': [ | |
104 '$(OutDir)\\<(pgd_basename).pgd', | |
105 ], | |
106 'dependencies': [ | |
107 'test_pgo_main', | |
108 'gen_profile_guided_database', | |
109 ], | |
110 }, | |
111 { | |
112 'target_name': 'test_pgo_update', | |
113 'type': 'executable', | |
114 'msvs_settings': { | |
115 'VCLinkerTool': { | |
116 'LinkTimeCodeGeneration': '4', | |
117 }, | |
118 }, | |
119 'sources': [ | |
120 '$(OutDir)\\<(pgd_basename).pgd', | |
121 ], | |
122 'dependencies': [ | |
123 'test_pgo_main', | |
124 ], | |
125 }, | |
126 # A helper target to dump link.exe's command line options. We can use the | |
127 # output to determine if PGO (Profile-Guided Optimization) is available on | |
128 # the test environment. | |
129 { | |
130 'target_name': 'gen_linker_option', | |
131 'type': 'none', | |
132 'msvs_cygwin_shell': 0, | |
133 'actions': [ | |
134 { | |
135 'action_name': 'action_main', | |
136 'inputs': [], | |
137 'outputs': [ | |
138 '$(OutDir)\\linker_options.txt', | |
139 ], | |
140 'action': [ | |
141 'cmd.exe', '/c link.exe > $(OutDir)\\linker_options.txt & exit 0', | |
142 ], | |
143 }, | |
144 ], | |
145 }, | |
146 ] | |
147 } | |
OLD | NEW |