Skip to content

Commit

Permalink
Add gflags dependency
Browse files Browse the repository at this point in the history
Unit tests currently use environment variables to change behavior.
Using gflags this can be done via command line.

BUG=libyuv:507
TBR=fbarchard@chromium.org

Review URL: https://codereview.chromium.org/1413723002 .
  • Loading branch information
Henrik Kjellander committed Oct 16, 2015
1 parent f80cc26 commit 8dcec01
Show file tree
Hide file tree
Showing 14 changed files with 2,005 additions and 45 deletions.
121 changes: 89 additions & 32 deletions .gitignore
@@ -1,38 +1,95 @@
*.pyc
.gn
pin-log.txt
base
build
buildtools
chromium/.gclient.tmp
chromium/.gclient.tmp_entries
chromium/.last_sync_chromium
chromium/src/
google_apis
links
net
out/
sde-avx-sse-transition-out.txt
testing
third_party/
tools/android
tools/clang
tools/find_depot_tools.py
tools/generate_library_loader
tools/gn
tools/grit
tools/gyp
tools/isolate_driver.py
tools/memory
tools/protoc_wrapper
tools/python
tools/relocation_packer
tools/sanitizer_options
tools/swarming_client
tools/tsan_suppressions
tools/valgrind
tools/vim
tools/win
/base
/build
/buildtools
/chromium/.gclient.tmp
/chromium/.gclient.tmp_entries
/chromium/.last_sync_chromium
/chromium/src/
/google_apis
/links
/net
/out
/sde-avx-sse-transition-out.txt
/testing
/third_party/android_platform
/third_party/android_testrunner
/third_party/android_tools
/third_party/appurify-python
/third_party/asan
/third_party/ashmem
/third_party/binutils
/third_party/boringssl
/third_party/BUILD.gn
/third_party/clang_format
/third_party/class-dump
/third_party/colorama
/third_party/cygwin
/third_party/directxsdk
/third_party/drmemory
/third_party/expat
/third_party/gaeunit
/third_party/gflags/src
/third_party/icu
/third_party/instrumented_libraries
/third_party/ijar
/third_party/jsoncpp
/third_party/jsr-305
/third_party/junit
/third_party/junit-jar
/third_party/libc++
/third_party/libc++abi
/third_party/libevent
/third_party/libjingle
/third_party/libjpeg
/third_party/libjpeg_turbo
/third_party/libsrtp
/third_party/libvpx_new
/third_party/libxml
/third_party/libudev
/third_party/libyuv
/third_party/llvm
/third_party/llvm-build
/third_party/lss
/third_party/mockito
/third_party/modp_b64
/third_party/nss
/third_party/oauth2
/third_party/ocmock
/third_party/openmax_dl
/third_party/opus
/third_party/proguard
/third_party/protobuf
/third_party/requests
/third_party/robolectric
/third_party/sqlite
/third_party/syzygy
/third_party/usrsctp
/third_party/valgrind
/third_party/WebKit
/third_party/winsdk_samples/src
/third_party/yasm
/third_party/zlib
/tools/android
/tools/clang
/tools/find_depot_tools.py
/tools/generate_library_loader
/tools/gn
/tools/grit
/tools/gyp
/tools/isolate_driver.py
/tools/memory
/tools/protoc_wrapper
/tools/python
/tools/relocation_packer
/tools/sanitizer_options
/tools/swarming_client
/tools/tsan_suppressions
/tools/valgrind
/tools/vim
/tools/win

# Files generated by CMake build
cmake_install.cmake
Expand Down
33 changes: 22 additions & 11 deletions DEPS
@@ -1,31 +1,42 @@
vars = {
# Override root_dir in your .gclient's custom_vars to specify a custom root
# folder name.
"root_dir": "libyuv",
"extra_gyp_flag": "-Dextra_gyp_flag=0",
'root_dir': 'libyuv',
'extra_gyp_flag': '-Dextra_gyp_flag=0',
'chromium_git': 'https://chromium.googlesource.com',

# Roll the Chromium Git hash to pick up newer versions of all the
# dependencies and tools linked to in setup_links.py.
'chromium_revision': 'bb79186c63ff4eff7a2a318a21731005c53f269b',
}

# NOTE: Prefer revision numbers to tags for svn deps. Use http rather than
# https; the latter can cause problems for users behind proxies.
deps = {
'src/third_party/gflags/src':
Var('chromium_git') + '/external/gflags/src@e7390f9185c75f8d902c05ed7d20bb94eb914d0c', # from svn revision 82
}

# Define rules for which include paths are allowed in our source.
include_rules = [ '+gflags' ]

hooks = [
{
# Clone chromium and its deps.
"name": "sync chromium",
"pattern": ".",
"action": ["python", "-u", Var("root_dir") + "/sync_chromium.py",
"--target-revision", Var("chromium_revision")],
'name': 'sync chromium',
'pattern': '.',
'action': ['python', '-u', Var('root_dir') + '/sync_chromium.py',
'--target-revision', Var('chromium_revision')],
},
{
# Create links to shared dependencies in Chromium.
"name": "setup_links",
"pattern": ".",
"action": ["python", Var("root_dir") + "/setup_links.py"],
'name': 'setup_links',
'pattern': '.',
'action': ['python', Var('root_dir') + '/setup_links.py'],
},
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
"pattern": ".",
"action": ["python", Var("root_dir") + "/gyp_libyuv"],
'pattern': '.',
'action': ['python', Var('root_dir') + '/gyp_libyuv'],
},
]
2 changes: 1 addition & 1 deletion README.chromium
@@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1512
Version: 1513
License: BSD
License File: LICENSE

Expand Down
2 changes: 1 addition & 1 deletion include/libyuv/version.h
Expand Up @@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_

#define LIBYUV_VERSION 1512
#define LIBYUV_VERSION 1513

#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
62 changes: 62 additions & 0 deletions third_party/gflags/BUILD.gn
@@ -0,0 +1,62 @@
#
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

# This is a copy of WebRTC's BUILD.gn.

if (is_win) {
gflags_gen_arch_root = "gen/win"
} else {
gflags_gen_arch_root = "gen/posix"
}

config("gflags_config") {
include_dirs = [
"$gflags_gen_arch_root/include", # For configured files.
"src", # For everything else.
]

defines = [
# These macros exist so flags and symbols are properly exported when
# building DLLs. Since we don't build DLLs, we need to disable them.
"GFLAGS_DLL_DECL=",
"GFLAGS_DLL_DECLARE_FLAG=",
"GFLAGS_DLL_DEFINE_FLAG=",
]
}

source_set("gflags") {
sources = [
"src/gflags.cc",
"src/gflags_completions.cc",
"src/gflags_reporting.cc",
]
if (is_win) {
sources += [ "src/windows/port.cc" ]

cflags = [
"/wd4005", # WIN32_LEAN_AND_MEAN.
"/wd4267", # Conversion from size_t to "type".
]
}

include_dirs = [
"$gflags_gen_arch_root/include/private", # For config.h
]

public_configs = [ ":gflags_config" ]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]

if (is_clang) {
# TODO(andrew): Look into fixing this warning upstream:
# http://code.google.com/p/webrtc/issues/detail?id=760
configs -= [ "//build/config/clang:extra_warnings" ]
}
}
28 changes: 28 additions & 0 deletions third_party/gflags/LICENSE
@@ -0,0 +1,28 @@
Copyright (c) 2006, Google Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 changes: 28 additions & 0 deletions third_party/gflags/README.libyuv
@@ -0,0 +1,28 @@
URL: http://code.google.com/p/gflags/
Version: 2.0
License: New BSD
License File: LICENSE

Description:
The gflags package contains a library that implements commandline
flags processing. As such it's a replacement for getopt(). It has
increased flexibility, including built-in support for C++ types like
string, and the ability to define flags in the source file in which
they're used.

Local Modifications: None


How to update platform configuration files:
The gen/ directory contains pre-generated configuration header files.
Historically, all operating systems and architectures have generated
similar configurations except for Windows. This is why there's only
posix and win directories below gen/.
When rolling gflags to a newer version, it's a good idea to check if
new configuration files needs to be generated as well.
Do this by running ./configure in the newly checked out version of
gflags. Then diff the generated files with the ones below gen/.
If you notice a diff, update the files with the updated ones.
If you suspect platform dependend changes other than Windows, you'll
have to checkout gflags on the other platforms as well and run
./configure there too.

0 comments on commit 8dcec01

Please sign in to comment.