Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: gn/BUILD.gn

Issue 2167163002: Basic standalone GN configs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fmt Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gn.py ('k') | gn/BUILDCONFIG.gn » ('j') | gn/BUILDCONFIG.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gn/BUILD.gn
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..547f57ebea9202a5bf9dcd43457c8e07b580c42d
--- /dev/null
+++ b/gn/BUILD.gn
@@ -0,0 +1,122 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+declare_args() {
+ ar = "ar"
+ cc = "cc"
+ cxx = "c++"
+}
+
+config("default") {
+ cflags = [
+ "-g",
+ "-fstrict-aliasing",
+ "-fPIC",
+
+ "-Werror",
+ "-Wall",
+ "-Wextra",
+ "-Winit-self",
+ "-Wpointer-arith",
+ "-Wsign-compare",
+ "-Wvla",
+
+ "-Wno-deprecated-declarations",
+ "-Wno-unused-parameter",
+ ]
+ cflags_cc = [
+ "-std=c++11",
+ "-fno-exceptions",
+ "-fno-rtti",
+ "-fno-threadsafe-statics",
+
+ "-Wnon-virtual-dtor",
+ ]
+}
+
+config("release") {
+ cflags = [ "-Os" ]
+ defines = [ "NDEBUG" ]
+}
+
+config("executable") {
+ if (is_mac) {
+ ldflags = [ "-Wl,-rpath,@loader_path/." ]
+ } else if (is_linux) {
+ ldflags = [ "-Wl,-rpath,\$ORIGIN" ]
+ }
+}
+
+toolchain("gcc_like") {
+ lib_switch = "-l"
+ lib_dir_switch = "-L"
+
+ tool("cc") {
+ depfile = "{{output}}.d"
+ command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ depsformat = "gcc"
+ outputs = [
+ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ ]
+ }
+
+ tool("cxx") {
+ depfile = "{{output}}.d"
+ command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
+ depsformat = "gcc"
+ outputs = [
+ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ ]
+ }
+
+ tool("asm") {
+ depfile = "{{output}}.d"
+ command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
+ depsformat = "gcc"
+ outputs = [
+ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ ]
+ }
+
+ tool("alink") {
+ command = "rm -f {{output}} && $ar rcs {{output}} {{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}}"
+
+ rpath = "-Wl,-soname,$soname"
+ if (is_mac) {
+ rpath = "-Wl,-install_name,@rpath/$soname"
+ }
+
+ command = "$cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath -o {{output}}"
+ outputs = [
+ "{{root_out_dir}}/$soname",
+ ]
+ output_prefix = "lib"
+ default_output_extension = ".so"
+ }
+
+ tool("link") {
+ command = "$cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}"
+ outputs = [
+ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}",
+ ]
+ }
+
+ tool("stamp") {
+ command = "touch {{output}}"
+ }
+
+ tool("copy") {
+ command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
+ }
+}
« no previous file with comments | « gn.py ('k') | gn/BUILDCONFIG.gn » ('j') | gn/BUILDCONFIG.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698