From b7fb1fd087cfe20cfc29cabc80af2c11e91538c6 Mon Sep 17 00:00:00 2001 From: thestig Date: Fri, 26 Aug 2016 14:39:31 -0700 Subject: Remove most things GYP. BUG=pdfium:559 Review-Url: https://codereview.chromium.org/2286653002 --- DEPS | 7 +- build_gyp/all.gyp | 17 - build_gyp/gyp_pdfium | 71 -- build_gyp/gyp_pdfium.py | 8 - build_gyp/set_clang_warning_flags.gypi | 58 -- build_gyp/standalone.gypi | 591 ---------------- pdfium.gyp | 1176 -------------------------------- samples/samples.gyp | 100 --- testing/gmock.gyp | 57 -- testing/gtest.gyp | 175 ----- testing/libfuzzer/fuzzers.gyp | 171 ----- third_party/third_party.gyp | 477 ------------- xfa.gyp | 618 ----------------- 13 files changed, 1 insertion(+), 3525 deletions(-) delete mode 100644 build_gyp/all.gyp delete mode 100755 build_gyp/gyp_pdfium delete mode 100644 build_gyp/gyp_pdfium.py delete mode 100644 build_gyp/set_clang_warning_flags.gypi delete mode 100644 build_gyp/standalone.gypi delete mode 100644 pdfium.gyp delete mode 100644 samples/samples.gyp delete mode 100644 testing/gmock.gyp delete mode 100644 testing/gtest.gyp delete mode 100644 testing/libfuzzer/fuzzers.gyp delete mode 100644 third_party/third_party.gyp delete mode 100644 xfa.gyp diff --git a/DEPS b/DEPS index 7e32009166..d168db760a 100644 --- a/DEPS +++ b/DEPS @@ -50,6 +50,7 @@ deps = { Var('chromium_git') + "/chromium/src/tools/generate_library_loader@" + Var('gen_library_loader_revision'), + # TODO(GYP): Remove this when no tools rely on GYP anymore. "tools/gyp": Var('chromium_git') + '/external/gyp.git' + '@' + 'c61b0b35c8396bfd59efc6cfc11401d912b0f510', @@ -138,12 +139,6 @@ hooks = [ '--running-as-hook' ], }, - { - # A change to a .gyp, .gypi, or to GYP itself should run the generator. - 'name': 'gyp', - 'pattern': '.', - 'action': ['python', 'pdfium/build_gyp/gyp_pdfium'], - }, # Pull clang-format binaries using checked-in hashes. { 'name': 'clang_format_win', diff --git a/build_gyp/all.gyp b/build_gyp/all.gyp deleted file mode 100644 index 47097e39b4..0000000000 --- a/build_gyp/all.gyp +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2014 PDFium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'targets': [ - { - 'target_name': 'All', - 'type': 'none', - 'dependencies': [ - '../pdfium.gyp:*', - '../samples/samples.gyp:*', - '../testing/libfuzzer/fuzzers.gyp:*', - ], - } - ] -} diff --git a/build_gyp/gyp_pdfium b/build_gyp/gyp_pdfium deleted file mode 100755 index 6a2540391c..0000000000 --- a/build_gyp/gyp_pdfium +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2014 PDFium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script is wrapper for PDFium that adds some support for how GYP -# is invoked by PDFium beyond what can be done in the gclient hooks. - -import os -import platform -import sys - -script_dir = os.path.dirname(os.path.realpath(__file__)) -pdfium_root = os.path.abspath(os.path.join(script_dir, os.pardir)) -output_rel_dir = 'out' - -sys.path.insert(0, os.path.join(pdfium_root, 'tools', 'gyp', 'pylib')) -import gyp - -# vs_toolchain needs to be after gyp path setting since it also uses gyp. -sys.path.insert(0, os.path.join(pdfium_root, 'build')) -import vs_toolchain - -def run_gyp(args): - rc = gyp.main(args) - - # Copy Windows toolchain DLLs. - vs_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() - if vs_runtime_dll_dirs: - x64_runtime, x86_runtime = vs_runtime_dll_dirs - vs_toolchain.CopyVsRuntimeDlls( - os.path.join(pdfium_root, output_rel_dir), (x86_runtime, x64_runtime)) - - if rc != 0: - print 'Error running GYP' - sys.exit(rc) - - -def main(): - if int(os.environ.get('GYP_PDFIUM_NO_ACTION', 0)): - print 'Skipping gyp_pdfium due to GYP_PDFIUM_NO_ACTION env var.' - sys.exit(0) - - args = sys.argv[1:] - args.append(os.path.join(pdfium_root, 'build_gyp', 'all.gyp')) - - args.append('-I') - args.append(os.path.join(pdfium_root, 'build_gyp', 'standalone.gypi')) - - args.extend(['-D', 'gyp_output_dir=' + output_rel_dir]) - - # Set the GYP DEPTH variable to the root of the PDFium project. - args.append('--depth=' + os.path.relpath(pdfium_root)) - - # GYP does not default to ninja, but PDFium should. - if not os.environ.get('GYP_GENERATORS', ''): - print 'GYP_GENERATORS is not set, defaulting to ninja' - os.environ['GYP_GENERATORS'] = 'ninja' - - # Set up the environment variables. - vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() - - print 'Updating projects from gyp files...' - sys.stdout.flush() - - run_gyp(args) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build_gyp/gyp_pdfium.py b/build_gyp/gyp_pdfium.py deleted file mode 100644 index 6831702b54..0000000000 --- a/build_gyp/gyp_pdfium.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2014 PDFium 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 os - -path = os.path.abspath(os.path.split(__file__)[0]) -execfile(os.path.join(path, 'gyp_pdfium')) diff --git a/build_gyp/set_clang_warning_flags.gypi b/build_gyp/set_clang_warning_flags.gypi deleted file mode 100644 index f6d7aea700..0000000000 --- a/build_gyp/set_clang_warning_flags.gypi +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This file is meant to be included to set clang-specific compiler flags. -# To use this the following variable can be defined: -# clang_warning_flags: list: Compiler flags to pass to clang. -# clang_warning_flags_unset: list: Compiler flags to not pass to clang. -# -# Only use this in third-party code. In chromium_code, fix your code to not -# warn instead! -# -# Note that the gypi file is included in target_defaults, so it does not need -# to be explicitly included. -# -# Warning flags set by this will be used on all platforms. If you want to set -# warning flags on only some platforms, you have to do so manually. -# -# To use this, create a gyp target with the following form: -# { -# 'target_name': 'my_target', -# 'variables': { -# 'clang_warning_flags': ['-Wno-awesome-warning'], -# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'], -# } -# } - -{ - 'variables': { - 'clang_warning_flags_unset%': [], # Provide a default value. - }, - 'conditions': [ - ['clang==1', { - # This uses >@ instead of @< to also see clang_warning_flags set in - # targets directly, not just the clang_warning_flags in target_defaults. - 'cflags': [ '>@(clang_warning_flags)' ], - 'cflags!': [ '>@(clang_warning_flags_unset)' ], - 'xcode_settings': { - 'WARNING_CFLAGS': ['>@(clang_warning_flags)'], - 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'], - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'AdditionalOptions': [ '>@(clang_warning_flags)' ], - 'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ], - }, - }, - }], - ['clang==0 and host_clang==1', { - 'target_conditions': [ - ['_toolset=="host"', { - 'cflags': [ '>@(clang_warning_flags)' ], - 'cflags!': [ '>@(clang_warning_flags_unset)' ], - }], - ], - }], - ], -} diff --git a/build_gyp/standalone.gypi b/build_gyp/standalone.gypi deleted file mode 100644 index 4df8649c46..0000000000 --- a/build_gyp/standalone.gypi +++ /dev/null @@ -1,591 +0,0 @@ -# Copyright 2014 PDFium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Definitions to be used when building stand-alone PDFium binaries. - -{ - 'variables': { - 'component%': 'static_library', - 'chromium_code%': 0, - 'clang%': 0, - 'asan%': 0, - 'sanitizer_coverage%': 0, - 'use_goma%': 0, - 'gomadir%': '', - 'msvs_multi_core_compile%': '1', - 'pdf_enable_xfa%': 1, - 'variables': { - 'variables': { - 'variables': { - 'conditions': [ - ['OS=="linux" or OS=="mac"', { - # This handles the Unix platforms we generally deal with. - # Anything else gets passed through, which probably won't work - # very well; such hosts should pass an explicit target_arch - # to gyp. - 'host_arch%': - '