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

Side by Side Diff: build/go/rules.gni

Issue 556813003: Add Go build support for GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simply path computation Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 declare_args() {
6 # By default, there is no go build tool, because go builds are not supported.
7 go_build_tool = ""
8 }
9
10 template("go_test_binary") {
11 # Only available on linux for now.
12 assert(is_linux)
13 assert(defined(invoker.sources))
14 # assert(defined(invoker.go_base_module))
15 assert(go_build_tool != "")
16
17 static_library_name = target_name + "_static_library"
18
19 static_library(static_library_name) {
20 sources = invoker.additional_sources
21 deps = invoker.deps
22 complete_static_lib = true
23 }
24
25 action(target_name) {
26 deps = [
27 ":$static_library_name",
28 ]
29 script = "//build/go/go.py"
30 outputs = [ "${target_out_dir}/${target_name}" ]
31 # Since go test does not permit specifying an output directory or output
32 # binary name, we create a temporary build directory, and the python
33 # script will later identify the output, copy it to the target location,
34 # and clean up the temporary build directory.
35 build_dir = "${target_out_dir}/${target_name}_build"
36 args = [
37 "--",
38 "${go_build_tool}",
39 rebase_path(build_dir, root_build_dir),
40 rebase_path(target_out_dir, root_build_dir) + "/${target_name}",
41 rebase_path("//", root_build_dir),
42 "-I" + rebase_path("//"),
43 " -L" + rebase_path(target_out_dir) +
44 " -L" + rebase_path(root_build_dir + "/obj/third_party/libevent") +
45 " -l" + static_library_name +
46 " -lstdc++ -lpthread -lm -lglib-2.0 -levent",
47 "test", "-c",
48 ] + rebase_path(invoker.sources, build_dir)
49 }
50 }
OLDNEW
« build/go/go.py ('K') | « build/go/go.py ('k') | mojo/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698