• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The Chromium 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/swift_variables.h"
6 
7 namespace variables {
8 
9 // Swift target vars -----------------------------------------------------
10 
11 const char kSwiftBridgeHeader[] = "bridge_header";
12 const char kSwiftBridgeHeader_HelpShort[] =
13     "bridge_header: [string] Path to C/Objective-C compatibility header.";
14 const char kSwiftBridgeHeader_Help[] =
15     R"(bridge_header: [string] Path to C/Objective-C compatibility header.
16 
17   Valid for binary targets that contain Swift sources.
18 
19   Path to an header that includes C/Objective-C functions and types that
20   needs to be made available to the Swift module.
21 )";
22 
23 const char kSwiftModuleName[] = "module_name";
24 const char kSwiftModuleName_HelpShort[] =
25     "module_name: [string] The name for the compiled module.";
26 const char kSwiftModuleName_Help[] =
27     R"(module_name: [string] The name for the compiled module.
28 
29   Valid for binary targets that contain Swift sources.
30 
31   If module_name is not set, then this rule will use the target name.
32 )";
33 
InsertSwiftVariables(VariableInfoMap * info_map)34 void InsertSwiftVariables(VariableInfoMap* info_map) {
35   info_map->insert(std::make_pair(
36       kSwiftBridgeHeader,
37       VariableInfo(kSwiftBridgeHeader_HelpShort, kSwiftBridgeHeader_Help)));
38 
39   info_map->insert(std::make_pair(
40       kSwiftModuleName,
41       VariableInfo(kSwiftModuleName_HelpShort, kSwiftModuleName_Help)));
42 }
43 
44 }  // namespace variables
45