mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2026-08-18 06:55:34 +03:00
Import chromium-63.0.3239.132
This commit is contained in:
2
tools/gn/example/.gn
Normal file
2
tools/gn/example/.gn
Normal file
@@ -0,0 +1,2 @@
|
||||
# The location of the build configuration file.
|
||||
buildconfig = "//build/BUILDCONFIG.gn"
|
||||
30
tools/gn/example/BUILD.gn
Normal file
30
tools/gn/example/BUILD.gn
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright 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.
|
||||
|
||||
executable("hello") {
|
||||
sources = [
|
||||
"hello.cc",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":hello_shared",
|
||||
":hello_static",
|
||||
]
|
||||
}
|
||||
|
||||
shared_library("hello_shared") {
|
||||
sources = [
|
||||
"hello_shared.cc",
|
||||
"hello_shared.h",
|
||||
]
|
||||
|
||||
defines = [ "HELLO_SHARED_IMPLEMENTATION" ]
|
||||
}
|
||||
|
||||
static_library("hello_static") {
|
||||
sources = [
|
||||
"hello_static.cc",
|
||||
"hello_static.h",
|
||||
]
|
||||
}
|
||||
4
tools/gn/example/README.txt
Normal file
4
tools/gn/example/README.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
This is an example directory structure that compiles some simple targets using
|
||||
gcc. It is intended to show how to set up a simple GN build.
|
||||
|
||||
Don't miss the ".gn" file in this directory!
|
||||
19
tools/gn/example/build/BUILD.gn
Normal file
19
tools/gn/example/build/BUILD.gn
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright 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.
|
||||
|
||||
config("compiler_defaults") {
|
||||
if (current_os == "linux") {
|
||||
cflags = [
|
||||
"-fPIC",
|
||||
"-pthread",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
config("executable_ldconfig") {
|
||||
ldflags = [
|
||||
"-Wl,-rpath=\$ORIGIN/",
|
||||
"-Wl,-rpath-link=",
|
||||
]
|
||||
}
|
||||
38
tools/gn/example/build/BUILDCONFIG.gn
Normal file
38
tools/gn/example/build/BUILDCONFIG.gn
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright 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.
|
||||
|
||||
if (target_os == "") {
|
||||
target_os = host_os
|
||||
}
|
||||
if (target_cpu == "") {
|
||||
target_cpu = host_cpu
|
||||
}
|
||||
if (current_cpu == "") {
|
||||
current_cpu = target_cpu
|
||||
}
|
||||
if (current_os == "") {
|
||||
current_os = target_os
|
||||
}
|
||||
|
||||
# All binary targets will get this list of configs by default.
|
||||
_shared_binary_target_configs = [ "//build:compiler_defaults" ]
|
||||
|
||||
# Apply that default list to the binary target types.
|
||||
set_defaults("executable") {
|
||||
configs = _shared_binary_target_configs
|
||||
|
||||
# Executables get this additional configuration.
|
||||
configs += [ "//build:executable_ldconfig" ]
|
||||
}
|
||||
set_defaults("static_library") {
|
||||
configs = _shared_binary_target_configs
|
||||
}
|
||||
set_defaults("shared_library") {
|
||||
configs = _shared_binary_target_configs
|
||||
}
|
||||
set_defaults("source_set") {
|
||||
configs = _shared_binary_target_configs
|
||||
}
|
||||
|
||||
set_default_toolchain("//build/toolchain:gcc")
|
||||
86
tools/gn/example/build/toolchain/BUILD.gn
Normal file
86
tools/gn/example/build/toolchain/BUILD.gn
Normal file
@@ -0,0 +1,86 @@
|
||||
# Copyright 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.
|
||||
|
||||
toolchain("gcc") {
|
||||
tool("cc") {
|
||||
depfile = "{{output}}.d"
|
||||
command = "gcc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "CC {{output}}"
|
||||
outputs = [
|
||||
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
|
||||
]
|
||||
}
|
||||
|
||||
tool("cxx") {
|
||||
depfile = "{{output}}.d"
|
||||
command = "g++ -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "CXX {{output}}"
|
||||
outputs = [
|
||||
"{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
|
||||
]
|
||||
}
|
||||
|
||||
tool("alink") {
|
||||
rspfile = "{{output}}.rsp"
|
||||
command = "rm -f {{output}} && ar rcs {{output}} @$rspfile"
|
||||
description = "AR {{target_output_name}}{{output_extension}}"
|
||||
rspfile_content = "{{inputs}}"
|
||||
outputs = [
|
||||
"{{target_out_dir}}/{{target_output_name}}{{output_extension}}",
|
||||
]
|
||||
default_output_extension = ".a"
|
||||
output_prefix = "lib"
|
||||
}
|
||||
|
||||
tool("solink") {
|
||||
soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
|
||||
sofile = "{{output_dir}}/$soname"
|
||||
rspfile = soname + ".rsp"
|
||||
|
||||
command = "g++ -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile"
|
||||
rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}"
|
||||
|
||||
description = "SOLINK $soname"
|
||||
|
||||
# Use this for {{output_extension}} expansions unless a target manually
|
||||
# overrides it (in which case {{output_extension}} will be what the target
|
||||
# specifies).
|
||||
default_output_extension = ".so"
|
||||
|
||||
# Use this for {{output_dir}} expansions unless a target manually overrides
|
||||
# it (in which case {{output_dir}} will be what the target specifies).
|
||||
default_output_dir = "{{root_out_dir}}"
|
||||
|
||||
outputs = [
|
||||
sofile,
|
||||
]
|
||||
link_output = sofile
|
||||
depend_output = sofile
|
||||
output_prefix = "lib"
|
||||
}
|
||||
|
||||
tool("link") {
|
||||
outfile = "{{target_output_name}}{{output_extension}}"
|
||||
rspfile = "$outfile.rsp"
|
||||
command = "g++ {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}}"
|
||||
description = "LINK $outfile"
|
||||
default_output_dir = "{{root_out_dir}}"
|
||||
rspfile_content = "{{inputs}}"
|
||||
outputs = [
|
||||
outfile,
|
||||
]
|
||||
}
|
||||
|
||||
tool("stamp") {
|
||||
command = "touch {{output}}"
|
||||
description = "STAMP {{output}}"
|
||||
}
|
||||
|
||||
tool("copy") {
|
||||
command = "cp -af {{source}} {{output}}"
|
||||
description = "COPY {{source}} {{output}}"
|
||||
}
|
||||
}
|
||||
13
tools/gn/example/hello.cc
Normal file
13
tools/gn/example/hello.cc
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 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.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hello_shared.h"
|
||||
#include "hello_static.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
printf("%s, %s\n", GetStaticText(), GetSharedText());
|
||||
return 0;
|
||||
}
|
||||
9
tools/gn/example/hello_shared.cc
Normal file
9
tools/gn/example/hello_shared.cc
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 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.
|
||||
|
||||
#include "hello_shared.h"
|
||||
|
||||
const char* GetSharedText() {
|
||||
return "world";
|
||||
}
|
||||
32
tools/gn/example/hello_shared.h
Normal file
32
tools/gn/example/hello_shared.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 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.
|
||||
|
||||
#ifndef TOOLS_GN_EXAMPLE_HELLO_SHARED_H_
|
||||
#define TOOLS_GN_EXAMPLE_HELLO_SHARED_H_
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
#if defined(HELLO_SHARED_IMPLEMENTATION)
|
||||
#define HELLO_EXPORT __declspec(dllexport)
|
||||
#define HELLO_EXPORT_PRIVATE __declspec(dllexport)
|
||||
#else
|
||||
#define HELLO_EXPORT __declspec(dllimport)
|
||||
#define HELLO_EXPORT_PRIVATE __declspec(dllimport)
|
||||
#endif // defined(HELLO_SHARED_IMPLEMENTATION)
|
||||
|
||||
#else
|
||||
|
||||
#if defined(HELLO_SHARED_IMPLEMENTATION)
|
||||
#define HELLO_EXPORT __attribute__((visibility("default")))
|
||||
#define HELLO_EXPORT_PRIVATE __attribute__((visibility("default")))
|
||||
#else
|
||||
#define HELLO_EXPORT
|
||||
#define HELLO_EXPORT_PRIVATE
|
||||
#endif // defined(HELLO_SHARED_IMPLEMENTATION)
|
||||
|
||||
#endif
|
||||
|
||||
HELLO_EXPORT const char* GetSharedText();
|
||||
|
||||
#endif // TOOLS_GN_EXAMPLE_HELLO_SHARED_H_
|
||||
9
tools/gn/example/hello_static.cc
Normal file
9
tools/gn/example/hello_static.cc
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright 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.
|
||||
|
||||
#include "hello_static.h"
|
||||
|
||||
const char* GetStaticText() {
|
||||
return "Hello";
|
||||
}
|
||||
10
tools/gn/example/hello_static.h
Normal file
10
tools/gn/example/hello_static.h
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright 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.
|
||||
|
||||
#ifndef TOOLS_GN_EXAMPLE_HELLO_STATIC_H_
|
||||
#define TOOLS_GN_EXAMPLE_HELLO_STATIC_H_
|
||||
|
||||
const char* GetStaticText();
|
||||
|
||||
#endif // TOOLS_GN_EXAMPLE_HELLO_STATIC_H_
|
||||
Reference in New Issue
Block a user