(3)Configs配置 与单个target目标关联的config配置应与target目标同名,并用_config跟在它后面。如 target名称为foo,则对应的config名称为foo_config。 config配置应紧挨着使用它的相应target目标之前出现。 (4)Example 示例src/foo/BUILD.gn如下: 复制 #Copyright2016TheChromiumAuthors.Allrightsreserved....
target_type = "executable" # 添加源文件,可以使用通配符进行匹配 sources = [ "src/*.cpp", ] # 添加编译选项 cflags = [ "-Wall", "-O2", ] # 添加依赖关系 deps = [ "//path/to/dependency", ] 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19....
模版实例的名称,则通过target_name来承载,例如,我们定义了模版libaray,那么library(“aysnevent”)的target_name值就是”aysnevent" template(“library”) { assert(defined(invoker.sources), “Need sources in $target_name listing the source files.”) type = “static_library” if (is_win) { type =...
模版实例的名称,则通过target_name来承载,例如,我们定义了模版libaray,那么library(“aysnevent”)的target_name值就是”aysnevent" template(“library”) { assert(defined(invoker.sources), “Need sources in $target_name listing the source files.”) type = “static_library” if (is_win) { type =...
group:Declarea named group of targets.Thistarget type allows you to create meta-targets that just collect a set of dependencies into one named target.Groupscan additionally specify configs that apply to their dependents.VariablesDeps:data_deps,deps,public_depsDependentconfigs:all_dependent_configs,publ...
# Set up the default configuration for every build target of the given type. # The values configured here will be automatically set on the scope of the # corresponding target. Target definitions can add or remove to the settings # here as needed. # # WHAT GOES HERE? # # Othe...
target_type = "angle_shared_library" output_name = "${invoker.output_name}${angle_libs_suffix}" if (angle_egl_extension != "") { output_extension = angle_egl_extension } defines = invoker.defines + [ "LIBEGL_IMPLEMENTATION" ] if (is_win) { defines += [ "EGLAPI=" ] ...
通过gn desc <build_dir> <targetname> 可以了解一个目标的详细信息。通过 gn desc <build_dir> <targetname> deps --tree 可以查找一个目标的依赖信息。 simple_build$ gn desc ../out/build //:hello Target //:hello type: executable toolchain: //build/toolchain:gccvisibility*metadata{}testonlyfalse...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
static_library: Declare a static library target.(生成静态链接库,.lib or .a) target: Declare an target with the given programmatic type. 因此,我们的hello示例其实也只是增加了一个executable target。 4.4 新增配置 使用config可以提供一个公共的配置对象,包括编译flag、include、defines等,可被其他target包含...