blob: 1269684d2c497b1a3cde18435b96a17c5ca62cad [file] [log] [blame]
# -*- python -*-
# Copyright 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import gyp_extract
Import('env')
# Underlay $SOURCE_ROOT/ppapi in this directory.
Dir('.').addRepository(Dir('#/../ppapi'))
if env.Bit('linux'):
env.Append(CCFLAGS=['-fPIC'])
# Don't treat warnings as errors on Windows
if env.Bit('windows'):
env.FilterOut(CCFLAGS=['/WX'])
# TODO(ncbray): reenable
# http://code.google.com/p/nativeclient/issues/detail?id=1643
env.FilterOut(CCFLAGS=['-Wswitch-enum'])
# Load ppapi_cpp.gypi
# Unfortunately gyp_extract does not handle variables or includes so we must
# pull the list of sources from ppapi_sources.gypi directly.
ppapi_sources_gypi = open(
env.File('$SOURCE_ROOT/ppapi/ppapi_sources.gypi').abspath, 'r').read()
ppapi_sources_list = eval(ppapi_sources_gypi)['variables']['cpp_source_files']
ppapi_cpp_gypi = gyp_extract.LoadGypFile(
env.File('$SOURCE_ROOT/ppapi/ppapi_cpp.gypi').abspath)
cpp_sources = (
[src for src in ppapi_sources_list if src.endswith('.cc')] +
gyp_extract.GypTargetSources(
ppapi_cpp_gypi, 'ppapi_cpp', '.*\.cc')
)
env.DualLibrary('ppapi_cpp', cpp_sources)