mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 1 | # Copyright 2016 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | declare_args() { |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 7 | ar = "ar" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 8 | cc = "cc" |
| 9 | cxx = "c++" |
mtklein | 8079ba6 | 2016-08-16 09:31:16 -0700 | [diff] [blame] | 10 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 11 | if (is_android) { |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 12 | ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar" |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 13 | cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang" |
| 14 | cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++" |
| 15 | } |
| 16 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 17 | windk = "" |
| 18 | |
mtklein | 8079ba6 | 2016-08-16 09:31:16 -0700 | [diff] [blame] | 19 | extra_cflags = "" |
| 20 | extra_cflags_c = "" |
| 21 | extra_cflags_cc = "" |
mtklein | bb35a6a | 2016-09-01 09:15:44 -0700 | [diff] [blame] | 22 | extra_ldflags = "" |
mtklein | cab0bb7 | 2016-08-26 13:43:19 -0700 | [diff] [blame] | 23 | |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 24 | cc_wrapper = "" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 25 | } |
| 26 | |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 27 | config("default") { |
| 28 | asmflags = [] |
| 29 | cflags = [] |
| 30 | cflags_c = [] |
| 31 | cflags_cc = [] |
| 32 | defines = [] |
| 33 | ldflags = [] |
| 34 | |
| 35 | if (is_win) { |
| 36 | cflags += [ |
| 37 | "/FS", # Preserve previous PDB behavior. |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 38 | "/bigobj", # Some of our files are bigger than the regular limits. |
| 39 | ] |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 40 | cflags_c += [ "/TC" ] |
| 41 | cflags_cc += [ "/TP" ] |
| 42 | defines += [ |
| 43 | "_HAS_EXCEPTIONS=0", |
| 44 | "WIN32_LEAN_AND_MEAN", |
| 45 | "NOMINMAX", |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 46 | ] |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 47 | } else { |
| 48 | cflags += [ |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 49 | "-O1", |
| 50 | "-fstrict-aliasing", |
| 51 | "-fPIC", |
| 52 | "-fvisibility=hidden", |
mtklein | 2b3c2a3 | 2016-09-08 08:39:34 -0700 | [diff] [blame] | 53 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 54 | "-Werror", |
| 55 | "-Wall", |
| 56 | "-Wextra", |
| 57 | "-Winit-self", |
| 58 | "-Wpointer-arith", |
| 59 | "-Wsign-compare", |
| 60 | "-Wvla", |
| 61 | |
| 62 | "-Wno-deprecated-declarations", |
| 63 | "-Wno-unused-parameter", |
mtklein | 2b3c2a3 | 2016-09-08 08:39:34 -0700 | [diff] [blame] | 64 | ] |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 65 | cflags_cc += [ |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 66 | "-std=c++11", |
| 67 | "-fno-exceptions", |
| 68 | "-fno-threadsafe-statics", |
| 69 | "-fvisibility-inlines-hidden", |
| 70 | |
| 71 | "-Wnon-virtual-dtor", |
| 72 | ] |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 73 | } |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 74 | |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 75 | if (current_cpu == "arm") { |
| 76 | cflags += [ |
| 77 | "-march=armv7-a", |
| 78 | "-mfpu=neon", |
| 79 | "-mthumb", |
| 80 | ] |
| 81 | } else if (current_cpu == "mipsel") { |
| 82 | cflags += [ |
| 83 | "-march=mips32r2", |
| 84 | "-mdspr2", |
| 85 | ] |
| 86 | } else if (current_cpu == "x86") { |
| 87 | asmflags += [ "-m32" ] |
| 88 | cflags += [ |
| 89 | "-m32", |
| 90 | "-msse2", |
| 91 | "-mfpmath=sse", |
| 92 | ] |
| 93 | ldflags += [ "-m32" ] |
| 94 | } |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 95 | |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 96 | if (is_android) { |
| 97 | asmflags += [ |
| 98 | "--target=$ndk_target", |
| 99 | "-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin", |
| 100 | ] |
| 101 | cflags += [ |
| 102 | "--sysroot=$ndk/platforms/$ndk_platform", |
| 103 | "--target=$ndk_target", |
| 104 | "-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin", |
| 105 | ] |
| 106 | cflags_cc += [ |
| 107 | "-isystem$ndk/sources/android/support/include", |
| 108 | "-isystem$ndk/sources/cxx-stl/llvm-libc++/libcxx/include", |
| 109 | ] |
| 110 | ldflags += [ |
| 111 | "--sysroot=$ndk/platforms/$ndk_platform", |
| 112 | "--target=$ndk_target", |
| 113 | "-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin", |
| 114 | "-pie", |
| 115 | ] |
| 116 | lib_dirs = [ |
| 117 | "$ndk/sources/cxx-stl/llvm-libc++/libs/$ndk_stdlib", |
| 118 | "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/lib/gcc/$ndk_target/4.9.x", |
| 119 | ] |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 120 | |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 121 | libs = [ |
| 122 | # Order matters here! Keep these three in exactly this order. |
| 123 | "c++_static", |
| 124 | "c++abi", |
| 125 | "android_support", |
| 126 | ] |
| 127 | if (target_cpu == "arm") { |
| 128 | libs += [ "unwind" ] |
mtklein | 2b3c2a3 | 2016-09-08 08:39:34 -0700 | [diff] [blame] | 129 | } |
| 130 | } |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 131 | |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 132 | if (is_linux) { |
| 133 | libs = [ "pthread" ] |
| 134 | } |
| 135 | |
| 136 | if (sanitize != "") { |
| 137 | # You can either pass the sanitizers directly, e.g. "address,undefined", |
| 138 | # or pass one of the couple common aliases used by the bots. |
| 139 | sanitizers = sanitize |
| 140 | if (sanitize == "ASAN") { |
| 141 | sanitizers = "address,bool,function,integer-divide-by-zero,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift,signed-integer-overflow,unreachable,vla-bound,vptr" |
| 142 | } else if (sanitize == "TSAN") { |
| 143 | sanitizers = "thread" |
| 144 | } else if (sanitize == "MSAN") { |
| 145 | sanitizers = "memory" |
| 146 | } |
| 147 | |
| 148 | cflags += [ |
| 149 | "-fsanitize=$sanitizers", |
| 150 | "-fno-sanitize-recover=$sanitizers", |
| 151 | "-fsanitize-blacklist=" + rebase_path("../tools/xsan.blacklist"), |
| 152 | ] |
| 153 | ldflags += [ "-fsanitize=$sanitizers" ] |
| 154 | if (sanitizers == "memory") { |
| 155 | cflags += [ "-fsanitize-memory-track-origins" ] |
| 156 | cflags_cc += [ "-stdlib=libc++" ] |
| 157 | ldflags += [ "-stdlib=libc++" ] |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | config("debug_symbols") { |
| 163 | # It's annoying to wait for full debug symbols to push over |
| 164 | # to Android devices. -gline-tables-only is a lot slimmer. |
| 165 | if (is_android) { |
| 166 | cflags = [ "-gline-tables-only" ] |
| 167 | } else if (!is_win) { |
| 168 | cflags = [ "-g" ] |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | config("no_rtti") { |
| 173 | if (sanitize != "ASAN") { # -fsanitize=vptr requires RTTI |
| 174 | if (!is_win) { |
| 175 | cflags_cc = [ "-fno-rtti" ] |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | config("release") { |
| 181 | if (!is_win) { |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 182 | cflags = [ "-O3" ] |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 183 | } |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 184 | defines = [ "NDEBUG" ] |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | config("executable") { |
| 188 | if (is_mac) { |
| 189 | ldflags = [ "-Wl,-rpath,@loader_path/." ] |
| 190 | } else if (is_linux) { |
mtklein | a846c72 | 2016-09-15 10:44:15 -0700 | [diff] [blame] | 191 | ldflags = [ |
| 192 | "-rdynamic", |
| 193 | "-Wl,-rpath,\$ORIGIN", |
| 194 | ] |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 198 | toolchain("msvc") { |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 199 | vc = "$windk\VC\bin\amd64\cl.exe" |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 200 | vlink = "$windk\VC\bin\amd64\link.exe" |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 201 | vlib = "$windk\VC\bin\amd64\lib.exe" |
| 202 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 203 | # TODO: add a python function that generates the includes using <VSPATH>/win_sdk/bin/SetEnv.<cpu>.json |
| 204 | windk_include_dirs = "/I$windk\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\um /I$windk\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\shared /I$windk\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\winrt /I$windk\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\ucrt /I$windk\win_sdk\bin\..\..\VC\include /I$windk\win_sdk\bin\..\..\VC\atlmfc\include " |
| 205 | |
| 206 | tool("cc") { |
| 207 | rspfile = "{{output}}.rsp" |
| 208 | precompiled_header_type = "msvc" |
| 209 | pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" |
| 210 | |
| 211 | # Label names may have spaces in them so the pdbname must be quoted. The |
| 212 | # source and output don't need to be quoted because GN knows they're a |
| 213 | # full file name and will quote automatically when necessary. |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 214 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 215 | command = "$vc /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" |
| 216 | depsformat = "msvc" |
| 217 | description = "CC {{output}}" |
| 218 | outputs = [ |
| 219 | "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 220 | # "$object_subdir/{{source_name_part}}.obj", |
| 221 | ] |
| 222 | rspfile_content = "$windk_include_dirs {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" |
| 223 | } |
| 224 | |
| 225 | tool("cxx") { |
| 226 | rspfile = "{{output}}.rsp" |
| 227 | precompiled_header_type = "msvc" |
| 228 | pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" |
| 229 | |
| 230 | # Label names may have spaces in them so the pdbname must be quoted. The |
| 231 | # source and output don't need to be quoted because GN knows they're a |
| 232 | # full file name and will quote automatically when necessary. |
| 233 | command = "$vc /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" |
| 234 | depsformat = "msvc" |
| 235 | description = "C++ {{output}}" |
| 236 | outputs = [ |
| 237 | "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", |
| 238 | ] |
| 239 | rspfile_content = "$windk_include_dirs {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 240 | } |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 241 | |
| 242 | tool("alink") { |
| 243 | rspfile = "{{output}}.rsp" |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 244 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 245 | # gyp_win_tool_path = rebase_path("../third_party/externals/gyp/pylib/gyp/win_tool.py") |
| 246 | command = "$vlib /nologo {{arflags}} /OUT:{{output}} @$rspfile" |
| 247 | description = "LIB {{output}}" |
| 248 | outputs = [ |
| 249 | # Ignore {{output_extension}} and always use .lib, there's no reason to |
| 250 | # allow targets to override this extension on Windows. |
| 251 | "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
| 252 | ] |
| 253 | default_output_extension = ".lib" |
| 254 | default_output_dir = "{{target_out_dir}}" |
| 255 | |
| 256 | # The use of inputs_newline is to work around a fixed per-line buffer |
| 257 | # size in the linker. |
| 258 | rspfile_content = "{{inputs_newline}}" |
| 259 | } |
| 260 | |
| 261 | tool("link") { |
| 262 | exename = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" |
| 263 | pdbname = "$exename.pdb" |
| 264 | rspfile = "$exename.rsp" |
| 265 | |
| 266 | # gyp_win_tool_path = rebase_path("../third_party/externals/gyp/pylib/gyp/win_tool.py") |
| 267 | command = "$vlink /nologo /OUT:$exename /PDB:$pdbname @$rspfile" |
| 268 | |
| 269 | default_output_extension = ".exe" |
| 270 | default_output_dir = "{{root_out_dir}}" |
| 271 | description = "LINK {{output}}" |
| 272 | outputs = [ |
| 273 | #"{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
| 274 | exename, |
| 275 | ] |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 276 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 277 | #if (symbol_level != 0) { |
| 278 | # outputs += [ pdbname ] |
| 279 | #} |
| 280 | #runtime_outputs = outputs |
| 281 | |
| 282 | # The use of inputs_newline is to work around a fixed per-line buffer |
| 283 | # size in the linker. |
| 284 | rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" |
| 285 | } |
| 286 | |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 287 | tool("stamp") { |
| 288 | win_stamp_path = rebase_path("win_stamp.py") |
| 289 | command = "python $win_stamp_path {{output}}" |
| 290 | } |
| 291 | } |
| 292 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 293 | toolchain("gcc_like") { |
| 294 | lib_switch = "-l" |
| 295 | lib_dir_switch = "-L" |
| 296 | |
| 297 | tool("cc") { |
| 298 | depfile = "{{output}}.d" |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 299 | command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 300 | depsformat = "gcc" |
| 301 | outputs = [ |
| 302 | "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
| 303 | ] |
mtklein | cab0bb7 | 2016-08-26 13:43:19 -0700 | [diff] [blame] | 304 | description = |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 305 | "$cc_wrapper $cc ... $extra_cflags $extra_cflags_c -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | tool("cxx") { |
| 309 | depfile = "{{output}}.d" |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 310 | command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} $extra_cflags $extra_cflags_cc -c {{source}} -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 311 | depsformat = "gcc" |
| 312 | outputs = [ |
| 313 | "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
| 314 | ] |
mtklein | cab0bb7 | 2016-08-26 13:43:19 -0700 | [diff] [blame] | 315 | description = |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 316 | "$cc_wrapper $cxx ... $extra_cflags $extra_cflags_cc -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 317 | } |
| 318 | |
| 319 | tool("asm") { |
| 320 | depfile = "{{output}}.d" |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 321 | command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 322 | depsformat = "gcc" |
| 323 | outputs = [ |
| 324 | "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
| 325 | ] |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 326 | description = "$cc_wrapper $cc ... -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | tool("alink") { |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 330 | command = "rm -f {{output}} && $ar rcs {{output}} {{inputs}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 331 | outputs = [ |
mtklein | 5db44aa | 2016-07-29 09:10:31 -0700 | [diff] [blame] | 332 | "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 333 | ] |
| 334 | default_output_extension = ".a" |
| 335 | output_prefix = "lib" |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 336 | description = "$ar {{output}} ..." |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | tool("solink") { |
| 340 | soname = "{{target_output_name}}{{output_extension}}" |
| 341 | |
| 342 | rpath = "-Wl,-soname,$soname" |
| 343 | if (is_mac) { |
| 344 | rpath = "-Wl,-install_name,@rpath/$soname" |
| 345 | } |
| 346 | |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 347 | command = "$cc_wrapper $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath $extra_ldflags -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 348 | outputs = [ |
| 349 | "{{root_out_dir}}/$soname", |
| 350 | ] |
| 351 | output_prefix = "lib" |
| 352 | default_output_extension = ".so" |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 353 | description = "$cc_wrapper $cxx -shared ... $extra_ldflags -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | tool("link") { |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 357 | command = "$cc_wrapper $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} $extra_ldflags -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 358 | outputs = [ |
| 359 | "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
| 360 | ] |
mtklein | 60b7ab7 | 2016-09-20 12:09:12 -0700 | [diff] [blame^] | 361 | description = "$cc_wrapper $cxx ... $extra_ldflags -o {{output}}" |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | tool("stamp") { |
| 365 | command = "touch {{output}}" |
| 366 | } |
| 367 | |
| 368 | tool("copy") { |
| 369 | command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" |
| 370 | } |
| 371 | } |