GN 标签的完整语法是"dir:name",其中dir部分是命名了特定BUILD.gn文件的源路径。name指在该文件中使用target_type("name") { ... }定义的目标。简而言之,您可以定义一个名称与其所在目录名称相同的目标。无:部分的标签"//path/to/dir"是"//path/to/dir:dir"的略写。这是最常见的情况。
(3)Configs配置 与单个target目标关联的config配置应与target目标同名,并用_config跟在它后面。如 target名称为foo,则对应的config名称为foo_config。 config配置应紧挨着使用它的相应target目标之前出现。 (4)Example 示例src/foo/BUILD.gn如下: 复制 #Copyright2016TheChromiumAuthors.Allrightsreserved....
4.1、Source sets versus static libraries source_set与static_library的对比 在大多数情况下,源代码集和静态库可以互换使用。如果您不确定要使用什么,则source_set几乎永远不会出错,并且不太可能引起问题,但是在大型项目中使用正确类型的target目标类型可能很重要,因此您应该了解以下权衡。 静态库static_library遵循不同...
通过gn desc <build_dir> <targetname> 可以了解一个目标的详细信息。通过 gn desc <build_dir> <targetname> deps --tree 可以查找一个目标的依赖信息。 代码语言:GN AI代码解释 simple_build$ gn desc ../out/build //:hello Target //:hello type: executable toolchain: //build/toolchain:gccvisibilit...
target: Declare a target with the given programmatic type. Buildfile functions assert: Assert an expression is true at generation time. config: Defines a configuration object. declare_args: Declare build arguments. defined: Returns whether an identifier is defined. exec_script: Synchronously run a...
target(type, target_name) { configs += [ “//:qt_config”, ] sources = invoker.sources # output_prefix_override = true output_dir = “$root_out_dir” lib_dirs = [ rebase_path("$output_dir/libs"), ] if (type == “static_library”) { ...
# 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: Declare a target with the given programmatic type. Buildfile functions (type gn help <function>“ for more help):” assert: Assert an expression is true at generation time. config: Defines a configuration object. declare_args: Declare build arguments. defined: Returns whether an identifi...
target(_dll_target_type, "chrome_dll") { visibility = [ ":chrome_framework", ":chrome_framework_create_bundle", ":chrome_framework_shared_library", ] sources = [ "app/chrome_crash_reporter_client.cc", "app/chrome_crash_reporter_client.h", "app/chrome_crash_reporter_client...
2.70 gn help target_gen_dir 英文 中文 状态:todo 2.71 gn help target_name 英文 中文 状态:todo 2.72 gn help target_os 英文 中文 状态:todo 2.73 gn help target_out_dir 英文 中文 状态:todo 2.74 gn help aliased_deps 英文 中文 状态:todo ...