• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Open Harmony Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "gn/ohos_variables.h"
6 
7 namespace variables {
8 
9 // OpenHarmony target vars -----------------------------------------------------
10 
11 const char kCopyLinkableFile[] = "copy_linkable_file";
12 const char kCopyLinkableFile_HelpShort[] =
13     "copy_linkable_file: [boolean] Copy a linkable static or shared library.";
14 const char kCopyLinkableFile_Help[] =
15     R"(copy_linkable_file: [boolean] Copy a linkable static or shared library.
16 
17   A copy target normally doesn't export configs for targets that depend on it.
18   In some cases, a copy target is a linkable target, which means it is a static
19   or shared library with some public_configs to be exported.
20 
21   In this case, we can set copy_linkable_file to export configs.
22 
23 Example
24 
25   copy("foo") {
26     copy_linkable_file = true
27     public_configs = [ ":exported_header_files" ]
28   }
29 
30   executable("bar") {
31     # Target bar will get public_configs of foo target
32     deps = [ "foo" ]
33   }
34 )";
35 
36 const char kExternalDeps[] = "external_deps";
37 const char kExternalDeps_HelpShort[] =
38     "external_deps: [label list] Declare external dependencies for OpenHarmony component.";
39 const char kExternalDeps_Help[] =
40     R"(external_deps: Declare external dependencies for OpenHarmony component.
41 
42   External dependencies are like private dependencies (see "gn help deps") but
43   expressed in the form of: component_name:innerapi_name.
44     * component and innerapi are defined by OpenHarmony bundle.json.
45   With external_deps, deps can be added without absolute path.
46 
47   This variable is enabled by setting "ohos_components_support" in .gn file (see "gn help dotfile").
48 
49 Example
50 
51   # This target "a" can include libinitapi from "init" component
52   executable("a") {
53     deps = [ ":b" ]
54     external_deps = [ "init:libinitapi" ]
55   }
56 )";
57 
58 const char kPublicExternalDeps[] = "public_external_deps";
59 const char kPublicExternalDeps_HelpShort[] =
60     "public_external_deps: [label list] Declare public external dependencies for OpenHarmony component.";
61 const char kPublicExternalDeps_Help[] =
62     R"(public_external_deps: Declare public external dependencies for OpenHarmony component.
63 
64   Public external dependencies (public_external_deps) are like external_deps but additionally express that
65   the current target exposes the listed external_deps as part of its public API.
66 
67   This variable is enabled by setting "ohos_components_support" in .gn file (see "gn help dotfile").
68 
69 Example
70 
71   # Target "a" will include libinitapi from "init" component by deps "b":
72   executable("a") {
73     deps = [ ":b" ]
74   }
75 
76   shared_library("b") {
77     deps = [ ":b" ]
78     public_external_deps = [ "init:libinitapi" ]
79   }
80 )";
81 
82 const char kCopyRustCrateType[] = "rust_crate_type";
83 const char kCopyRustCrateType_HelpShort[] = "";
84 const char kCopyRustCrateType_Help[] = "";
85 
86 const char kCopyRustCrateName[] = "rust_crate_name";
87 const char kCopyRustCrateName_HelpShort[] = "";
88 const char kCopyRustCrateName_Help[] = "";
89 }  // namespace variables
90