Skip to content

Commit

Permalink
Get SCons building Windows again without having to Import()/re-Export…
Browse files Browse the repository at this point in the history
…(): use the $PLATFORM construction variable supplied in the construction environment instead of passing around our own PLATFORM variable in Python.

R=keunwoo,evanm

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
sgk@google.com committed Jul 31, 2008
1 parent bdad42a commit 14d15d4
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 47 deletions.
5 changes: 1 addition & 4 deletions build/SConscript.main.linux
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ import shutil
import sys


Import('PLATFORM')


# Base -------------------------------------------------------------------

base_env = Environment(
Expand Down Expand Up @@ -90,7 +87,7 @@ env = base_env.Clone()

for sconscript_dir, target_subdir in sconscript_and_target_subdirs:
env.SConscript(os.path.join(sconscript_dir, 'SConscript'),
exports=['env', 'PLATFORM'],
exports=['env'],
variant_dir=os.path.join('$TARGET_ROOT', target_subdir),
duplicate=0
)
15 changes: 2 additions & 13 deletions chrome/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,12 @@

build_component = 'chrome'

# TODO(keunwoo): This is an ugly hack to reify the result of scons's built-in
# platform detection as a variable (the RES attribute is only available
# under MSWindows). Once rspangler+sgk merge better idioms into Chrome's
# site scons, we should be able to remove this.
try:
Environment().RES
except AttributeError:
PLATFORM = 'LINUX'
else:
PLATFORM = 'WINDOWS'

# TODO(keunwoo): Merge ../build/SConscript.main.linux back to SConscript.main,
# then remove this.
if PLATFORM == 'LINUX':
if Environment()['PLATFORM'] == 'posix':
SCONSCRIPT_MAIN = '../build/SConscript.main.linux'
else:
SCONSCRIPT_MAIN = '../build/SConscript.main'

SConscript(SCONSCRIPT_MAIN,
exports=['build_component', 'PLATFORM'])
exports=['build_component'])
4 changes: 1 addition & 3 deletions third_party/bsdiff/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone()
Expand All @@ -40,7 +38,7 @@ env.Prepend(
]
)

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TP',
Expand Down
5 changes: 2 additions & 3 deletions third_party/bspatch/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone(
Expand All @@ -46,7 +44,8 @@ env.Append(
'_LZMA_IN_CB',
],
)
if PLATFORM == 'WINDOWS':

if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TP',
Expand Down
4 changes: 1 addition & 3 deletions third_party/bzip2/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone()

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TC',
Expand Down
4 changes: 1 addition & 3 deletions third_party/libjpeg/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone()
Expand All @@ -40,7 +38,7 @@ env.Prepend(
],
)

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TC',
Expand Down
4 changes: 1 addition & 3 deletions third_party/libpng/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone()
Expand All @@ -41,7 +39,7 @@ env.Prepend(
],
)

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TP',
Expand Down
23 changes: 11 additions & 12 deletions third_party/lzma_sdk/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Import('env')
Import('PLATFORM')

env = env.Clone(
)
Expand All @@ -47,7 +46,7 @@ env.Append(
],
)

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TC',
Expand All @@ -56,18 +55,18 @@ if PLATFORM == 'WINDOWS':
)

input_files = [
'Compress/Lzma/LzmaDecode.c',
'Archive/7z/7zMethodID.c',
'Archive/7z/7zItem.c',
'Archive/7z/7zIn.c',
'Archive/7z/7zHeader.c',
'Archive/7z/7zExtract.c',
'Archive/7z/7zDecode.c',
'Archive/7z/7zBuffer.c',
'7zCrc.c',
'Archive/7z/7zAlloc.c',
'Compress/Branch/BranchX86_2.c',
'Archive/7z/7zBuffer.c',
'Archive/7z/7zDecode.c',
'Archive/7z/7zExtract.c',
'Archive/7z/7zHeader.c',
'Archive/7z/7zIn.c',
'Archive/7z/7zItem.c',
'Archive/7z/7zMethodID.c',
'Compress/Branch/BranchX86.c',
'7zCrc.c',
'Compress/Branch/BranchX86_2.c',
'Compress/Lzma/LzmaDecode.c',
]

env.StaticLibrary('lzma_sdk', input_files)
4 changes: 1 addition & 3 deletions third_party/zlib/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# TODO(keunwoo): Use better cross-platform abstraction; see chrome/SConstruct
Import('PLATFORM')

Import('env')

env = env.Clone()

if PLATFORM == 'WINDOWS':
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
'/TC',
Expand Down

0 comments on commit 14d15d4

Please sign in to comment.