blob: 2a278cb9c8f9c5bd6c44d98593b911dc34e591a9 [file]
#!/usr/bin/python2.4
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ========================================================================
# Builds two versions of LongRunning. LongRunning.exe is a console app and will
# result in a console windows when run. LongRunningSilent.exe uses the Windows
# subsystem so that it does not throw up windows. It is useful for unit tests.
# There is a resource file, so that we can include a manifest that tells Windows
# Vista not to elevate this file. We need this when it is renamed to
# GoogleUpdate.exe for unit tests.
Import('env')
inputs = [
'long_running.cc',
env.RES('resource.rc'),
]
base_env = env.Clone()
base_env.Append(
LIBS = [
('libcmt.lib', 'libcmtd.lib')[base_env.Bit('debug')],
],
CPPDEFINES = [
'UNICODE',
'_UNICODE'
],
)
if base_env.Bit('debug'):
base_env.FilterOut(CCFLAGS=['/MTd'])
else:
base_env.FilterOut(CCFLAGS=['/MT'])
# Duplicate the common settings then set the unique settings for each build.
silent_env = base_env.Clone()
# Use different subdirectory to avoid having 2 obj files with the same name.
silent_env['OBJPREFIX'] = 'silent/' + silent_env['OBJPREFIX']
silent_env.ComponentProgram(
prog_name='LongRunningSilent.exe',
source=inputs,
)
base_env.FilterOut(LINKFLAGS = ['/SUBSYSTEM:WINDOWS'])
base_env['LINKFLAGS'] += [
'/SUBSYSTEM:CONSOLE',
'/ENTRY:WinMain',
]
base_env.ComponentProgram(
prog_name='LongRunning.exe',
source=inputs
)