| OLD | NEW |
| 1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 config("libdart_vm_config") { | 5 config("libdart_vm_config") { |
| 6 libs = [ | 6 libs = [ |
| 7 "dl", | 7 "dl", |
| 8 ] | 8 ] |
| 9 | 9 |
| 10 if (!is_android) { | 10 if (!is_android) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 "..", | 93 "..", |
| 94 ] | 94 ] |
| 95 } | 95 } |
| 96 | 96 |
| 97 | 97 |
| 98 template("generate_library_source") { | 98 template("generate_library_source") { |
| 99 assert(defined(invoker.libname), "Need libname in $target_name") | 99 assert(defined(invoker.libname), "Need libname in $target_name") |
| 100 assert(defined(invoker.filename), "Need a filename in $target_name") | 100 assert(defined(invoker.filename), "Need a filename in $target_name") |
| 101 assert(defined(invoker.kind), "Need kind in $target_name") | 101 assert(defined(invoker.kind), "Need kind in $target_name") |
| 102 assert(defined(invoker.output), "Need output in $target_name") | 102 assert(defined(invoker.output), "Need output in $target_name") |
| 103 assert(defined(invoker.path), "Need path in $target_name") |
| 103 action(target_name) { | 104 action(target_name) { |
| 104 visibility = [ ":*" ] # Only targets in this file can see this. | 105 visibility = [ ":*" ] # Only targets in this file can see this. |
| 105 libname = invoker.libname | 106 libname = invoker.libname |
| 106 filename = invoker.filename | 107 filename = invoker.filename |
| 107 kind = invoker.kind | 108 kind = invoker.kind |
| 108 | 109 path = invoker.path |
| 109 if (kind == "source") { | |
| 110 path = "../../sdk/lib/${filename}" | |
| 111 } else { | |
| 112 path = "../lib" | |
| 113 } | |
| 114 | 110 |
| 115 lib_sources_gypi = | 111 lib_sources_gypi = |
| 116 exec_script("../../tools/gypi_to_gn.py", | 112 exec_script("../../tools/gypi_to_gn.py", |
| 117 [rebase_path("${path}/${filename}_sources.gypi")], | 113 [rebase_path("${path}/${filename}_sources.gypi")], |
| 118 "scope", | 114 "scope", |
| 119 ["${path}/${filename}_sources.gypi"]) | 115 ["${path}/${filename}_sources.gypi"]) |
| 120 lib_sources = | 116 lib_sources = |
| 121 rebase_path(lib_sources_gypi.sources, ".", path) | 117 rebase_path(lib_sources_gypi.sources, ".", path) |
| 122 | 118 |
| 123 script = "../tools/gen_library_src_paths.py" | 119 script = "../tools/gen_library_src_paths.py" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 148 # actions for each. After that, it generates targets to compile the generated | 144 # actions for each. After that, it generates targets to compile the generated |
| 149 # sources to make libdart_lib_nosnapshot and libdart_lib. | 145 # sources to make libdart_lib_nosnapshot and libdart_lib. |
| 150 template("generate_core_libraries") { | 146 template("generate_core_libraries") { |
| 151 assert(defined(invoker.sources), "Need sources in $target_name") | 147 assert(defined(invoker.sources), "Need sources in $target_name") |
| 152 liboutputs = [] | 148 liboutputs = [] |
| 153 libsources = [] | 149 libsources = [] |
| 154 libdeps = [] | 150 libdeps = [] |
| 155 foreach(lib, invoker.sources) { | 151 foreach(lib, invoker.sources) { |
| 156 libname = lib[0] | 152 libname = lib[0] |
| 157 filename = lib[1] | 153 filename = lib[1] |
| 154 do_patch = lib[2] |
| 155 source_path = lib[3] |
| 158 generate_library_source("generate_${filename}_cc_file") { | 156 generate_library_source("generate_${filename}_cc_file") { |
| 159 libname = libname | 157 libname = libname |
| 160 filename = filename | 158 filename = filename |
| 161 kind = "source" | 159 kind = "source" |
| 160 path = source_path |
| 162 output = "$target_gen_dir/${filename}_gen.cc" | 161 output = "$target_gen_dir/${filename}_gen.cc" |
| 163 } | 162 } |
| 164 generate_library_source("generate_${filename}_patch_cc_file") { | 163 if (do_patch) { |
| 165 libname = libname | 164 patch_path = lib[4] |
| 166 filename = filename | 165 generate_library_source("generate_${filename}_patch_cc_file") { |
| 167 kind = "patch" | 166 libname = libname |
| 168 output = "$target_gen_dir/${filename}_patch_gen.cc" | 167 filename = filename |
| 168 kind = "patch" |
| 169 path = patch_path |
| 170 output = "$target_gen_dir/${filename}_patch_gen.cc" |
| 171 } |
| 169 } | 172 } |
| 170 lib_sources_gypi = | 173 lib_sources_gypi = |
| 171 exec_script("../../tools/gypi_to_gn.py", | 174 exec_script("../../tools/gypi_to_gn.py", |
| 172 [rebase_path("../lib/${filename}_sources.gypi")], | 175 [rebase_path("../lib/${filename}_sources.gypi")], |
| 173 "scope", | 176 "scope", |
| 174 ["../lib/${filename}_sources.gypi"]) | 177 ["../lib/${filename}_sources.gypi"]) |
| 175 libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib") | 178 libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib") |
| 176 liboutputs += ["$target_gen_dir/${filename}_gen.cc", | 179 liboutputs += ["$target_gen_dir/${filename}_gen.cc"] |
| 177 "$target_gen_dir/${filename}_patch_gen.cc"] | 180 libdeps += [":generate_${filename}_cc_file"] |
| 178 libdeps += [":generate_${filename}_cc_file", | 181 if (do_patch) { |
| 179 ":generate_${filename}_patch_cc_file"] | 182 liboutputs += ["$target_gen_dir/${filename}_patch_gen.cc"] |
| 183 libdeps += [":generate_${filename}_patch_cc_file"] |
| 184 } |
| 180 } | 185 } |
| 181 | 186 |
| 182 static_library("libdart_lib_nosnapshot") { | 187 static_library("libdart_lib_nosnapshot") { |
| 183 configs += ["..:dart_config"] | 188 configs += ["..:dart_config"] |
| 184 deps = libdeps | 189 deps = libdeps |
| 185 sources = libsources + ["bootstrap.cc"] + liboutputs | 190 sources = libsources + ["bootstrap.cc"] + liboutputs |
| 186 include_dirs = [ | 191 include_dirs = [ |
| 187 "..", | 192 "..", |
| 188 ] | 193 ] |
| 189 } | 194 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 200 sources = libsources + [ "bootstrap_nocore.cc", ] | 205 sources = libsources + [ "bootstrap_nocore.cc", ] |
| 201 include_dirs = [ | 206 include_dirs = [ |
| 202 "..", | 207 "..", |
| 203 ] | 208 ] |
| 204 } | 209 } |
| 205 } | 210 } |
| 206 | 211 |
| 207 | 212 |
| 208 generate_core_libraries("core_libraries") { | 213 generate_core_libraries("core_libraries") { |
| 209 sources = [ | 214 sources = [ |
| 210 ["async", "async"], | 215 ["async", "async", true, "../../sdk/lib/async", "../lib"], |
| 211 ["core", "core"], | 216 ["core", "core", true, "../../sdk/lib/core", "../lib"], |
| 212 ["collection", "collection"], | 217 ["collection", "collection", true, "../../sdk/lib/collection", "../lib"], |
| 213 ["convert", "convert"], | 218 ["convert", "convert", true, "../../sdk/lib/convert", "../lib"], |
| 214 ["developer", "developer"], | 219 ["developer", "developer", true, "../../sdk/lib/developer", "../lib"], |
| 215 ["_internal", "internal"], | 220 ["_internal", "internal", true, "../../sdk/lib/internal", "../lib"], |
| 216 ["isolate", "isolate"], | 221 ["isolate", "isolate", true, "../../sdk/lib/isolate", "../lib"], |
| 217 ["math", "math"], | 222 ["math", "math", true, "../../sdk/lib/math", "../lib"], |
| 218 ["mirrors", "mirrors"], | 223 ["mirrors", "mirrors", true, "../../sdk/lib/mirrors", "../lib"], |
| 219 ["profiler", "profiler"], | 224 ["profiler", "profiler", false, "../../sdk/lib/profiler"], |
| 220 ["typed_data", "typed_data"], | 225 ["typed_data", "typed_data", false, "../lib"], |
| 221 ["_vmservice", "vmservice"], | 226 ["_vmservice", "vmservice", true, "../../sdk/lib/vmservice", "../lib"], |
| 222 ] | 227 ] |
| 223 } | 228 } |
| OLD | NEW |