OLD | NEW |
| (Empty) |
1 #!/usr/bin/python2.4 | |
2 # Copyright 2009-2010 Google Inc. | |
3 # | |
4 # Licensed under the Apache License, Version 2.0 (the "License"); | |
5 # you may not use this file except in compliance with the License. | |
6 # You may obtain a copy of the License at | |
7 # | |
8 # http://www.apache.org/licenses/LICENSE-2.0 | |
9 # | |
10 # Unless required by applicable law or agreed to in writing, software | |
11 # distributed under the License is distributed on an "AS IS" BASIS, | |
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 # See the License for the specific language governing permissions and | |
14 # limitations under the License. | |
15 # ======================================================================== | |
16 | |
17 # Builds two versions of LongRunning. LongRunning.exe is a console app and will | |
18 # result in a console windows when run. LongRunningSilent.exe uses the Windows | |
19 # subsystem so that it does not throw up windows. It is useful for unit tests. | |
20 # There is a resource file, so that we can include a manifest that tells Windows | |
21 # Vista not to elevate this file. We need this when it is renamed to | |
22 # GoogleUpdate.exe for unit tests. | |
23 | |
24 Import('env') | |
25 | |
26 inputs = [ | |
27 'long_running.cc', | |
28 env.RES('run_as_invoker.res', '$MAIN_DIR/common/run_as_invoker.rc'), | |
29 ] | |
30 | |
31 base_env = env.Clone() | |
32 | |
33 base_env.Append( | |
34 LIBS = [ | |
35 ('libcmt.lib', 'libcmtd.lib')[base_env.Bit('debug')], | |
36 ], | |
37 CPPDEFINES = [ | |
38 'UNICODE', | |
39 '_UNICODE' | |
40 ], | |
41 ) | |
42 | |
43 if base_env.Bit('debug'): | |
44 base_env.FilterOut(CCFLAGS=['/MTd']) | |
45 else: | |
46 base_env.FilterOut(CCFLAGS=['/MT']) | |
47 | |
48 # Duplicate the common settings then set the unique settings for each build. | |
49 silent_env = base_env.Clone() | |
50 | |
51 # Use different subdirectory to avoid having 2 obj files with the same name. | |
52 silent_env['OBJPREFIX'] = 'silent/' + silent_env['OBJPREFIX'] | |
53 | |
54 silent_env.ComponentTestProgram( | |
55 prog_name='LongRunningSilent', | |
56 source=inputs, | |
57 COMPONENT_TEST_RUNNABLE=False | |
58 ) | |
59 | |
60 | |
61 base_env.FilterOut(LINKFLAGS = ['/SUBSYSTEM:WINDOWS']) | |
62 base_env['LINKFLAGS'] += [ | |
63 '/SUBSYSTEM:CONSOLE', | |
64 '/ENTRY:WinMain', | |
65 ] | |
66 | |
67 base_env.ComponentTestProgram( | |
68 prog_name='LongRunning', | |
69 source=inputs, | |
70 COMPONENT_TEST_RUNNABLE=False | |
71 ) | |
OLD | NEW |