On Fri, Oct 27, 2017 at 4:21 PM Dirk Pranke wrote:
> I think you've worked this out, but in case you haven't, let me know off-list. I can/will reply back to this thread with the conclusion.
checkout_libaom (it got renamed) needed to go in .gclient:custom_vars:
solutions = [
{
"url": "
https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"name": "src",
"deps_file": ".DEPS.git",
"custom_vars": {
"checkout_libaom": True,
},
},
]
Adding it to DEPS:gclient_gn_args puts it in src/build/config/gclient_args.gni:
gclient_gn_args = [
'checkout_libaom',
'checkout_nacl',
]
gclient_args.gni:
# Generated from '.DEPS.git'
checkout_libaom = true
checkout_nacl = true
Which can then be imported into third_party/libaom/options.gni to automatically set a gn arg:
import("//build/config/gclient_args.gni")
declare_args() {
enable_av1_decoder = checkout_libaom
}
And a flag is defined in third_party/libaom/BUILD.gn to create av1_features.h:
buildflag_header("av1_features") {
header = "av1_features.h"
flags = [
"ENABLE_AV1_DECODER=$enable_av1_decoder",
]
}
Which can be depended on by a downstream consumer:
deps += [ "//third_party/libaom", "//third_party/libaom:av1_features", ]
and used to turn things on:
#include "third_party/libaom/av1_features.h"
#if BUILDFLAG(ENABLE_AV1_DECODER)
#endif
> On Thu, Oct 26, 2017 at 12:38 PM, 'Johann Koenig' via Chromium-dev wrote:
>> I would like to add an entry to DEPS which requires a .gclient entry to checkout.
>>
>> I tried formatting it like so:
>> 'src/third_party/libaom/source/libaom': {
>> 'url': Var('aomedia_git') + '/aom.git' + '@' + 'd9f2286e4c0bbb0fee5719d151653247939c3847',
>> 'condition': 'enable_libaom == "yes"',
>> },
>>
>>
>> but setting
>> "enable_libaom": "yes",
>>
>> in .gclient did not work. I see a bunch of other things depending on "checkout_" or "host_os == "
>>
>> How do these get set? Ideally I want to use the same condition statement in .gn files.