bake-toolkit 2.20.4 → 2.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile.rb +3 -3
- data/bin/bake +46 -46
- data/bin/bake-doc +11 -11
- data/bin/bakery +179 -179
- data/bin/createVSProjects +213 -213
- data/documentation/_build/html/_sources/changelog.txt +456 -451
- data/documentation/_build/html/_sources/commandline/commandline.txt +107 -107
- data/documentation/_build/html/_sources/concepts/build_hierarchy.txt +34 -34
- data/documentation/_build/html/_sources/concepts/concepts.txt +14 -14
- data/documentation/_build/html/_sources/concepts/inject.txt +65 -65
- data/documentation/_build/html/_sources/concepts/link_order.txt +91 -91
- data/documentation/_build/html/_sources/concepts/prebuild.txt +56 -56
- data/documentation/_build/html/_sources/concepts/the_main_project.txt +45 -45
- data/documentation/_build/html/_sources/concepts/the_project_meta_file.txt +72 -72
- data/documentation/_build/html/_sources/ide/eclipse/eclipse.txt +25 -25
- data/documentation/_build/html/_sources/ide/eclipse/how_to_convert_existing_cdt_workspace.txt +31 -31
- data/documentation/_build/html/_sources/ide/eclipse/how_to_create_a_new_project_in_eclipse.txt +18 -18
- data/documentation/_build/html/_sources/ide/eclipse/how_to_create_a_workspace_in_eclipse.txt +27 -27
- data/documentation/_build/html/_sources/ide/eclipse/how_to_debug_in_eclipse.txt +38 -38
- data/documentation/_build/html/_sources/ide/eclipse/how_to_install_eclipse_plugin.txt +44 -44
- data/documentation/_build/html/_sources/ide/eclipse/how_to_use_bake_in_eclipse.txt +86 -86
- data/documentation/_build/html/_sources/ide/ide_integrations.txt +8 -8
- data/documentation/_build/html/_sources/ide/vs/how_to_create_vs_projects.txt +15 -15
- data/documentation/_build/html/_sources/ide/vs/how_to_debug_in_vs.txt +35 -35
- data/documentation/_build/html/_sources/ide/vs/how_to_used_bake_in_vs.txt +35 -35
- data/documentation/_build/html/_sources/ide/vs/vs.txt +10 -10
- data/documentation/_build/html/_sources/ide/vs/vs_install.txt +43 -43
- data/documentation/_build/html/_sources/index.txt +33 -33
- data/documentation/_build/html/_sources/install/install_bake.txt +112 -112
- data/documentation/_build/html/_sources/internal.txt +50 -50
- data/documentation/_build/html/_sources/known_issues.txt +9 -9
- data/documentation/_build/html/_sources/license.txt +4 -4
- data/documentation/_build/html/_sources/performance/performance.txt +104 -104
- data/documentation/_build/html/_sources/quickstart/quickstart.txt +70 -70
- data/documentation/_build/html/_sources/syntax/adapt_configs.txt +143 -143
- data/documentation/_build/html/_sources/syntax/auto_adjustment.txt +43 -43
- data/documentation/_build/html/_sources/syntax/derive_configs.txt +93 -94
- data/documentation/_build/html/_sources/syntax/project_meta_syntax.txt +19 -19
- data/documentation/_build/html/_sources/syntax/syntax.txt +11 -11
- data/documentation/_build/html/_sources/syntax/variable_substitutions.txt +147 -147
- data/documentation/_build/html/_sources/tips_and_tricks/dot.txt +34 -34
- data/documentation/_build/html/_sources/tips_and_tricks/how_to_use_bake_with_cygwin.txt +62 -62
- data/documentation/_build/html/_sources/tips_and_tricks/static_code_analysis.txt +122 -122
- data/documentation/_build/html/_sources/tips_and_tricks/the_bakery.txt +72 -72
- data/documentation/_build/html/_sources/tips_and_tricks/the_clang.txt +43 -43
- data/documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt +34 -34
- data/documentation/_build/html/_sources/why_bake/why_bake.txt +40 -40
- data/documentation/_build/html/changelog.html +7 -0
- data/documentation/_build/html/commandline/commandline.html +2 -2
- data/documentation/_build/html/concepts/link_order.html +2 -2
- data/documentation/_build/html/concepts/prebuild.html +2 -2
- data/documentation/_build/html/index.html +4 -4
- data/documentation/_build/html/performance/performance.html +2 -2
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/adapt_configs.html +2 -2
- data/documentation/_build/html/syntax/syntax.html +2 -2
- data/documentation/_build/html/tips_and_tricks/the_clang.html +2 -2
- data/documentation/_build/html/why_bake/why_bake.html +2 -2
- data/lib/adapt/config/loader.rb +112 -112
- data/lib/bake/bundle.rb +158 -158
- data/lib/bake/cache.rb +179 -180
- data/lib/bake/config/checks.rb +68 -68
- data/lib/bake/config/loader.rb +363 -363
- data/lib/bake/libElement.rb +176 -176
- data/lib/bake/mergeConfig.rb +208 -208
- data/lib/bake/model/language.rb +45 -45
- data/lib/bake/model/loader.rb +99 -99
- data/lib/bake/model/metamodel.rb +307 -307
- data/lib/bake/model/metamodel_ext.rb +27 -27
- data/lib/bake/options/create.rb +95 -95
- data/lib/bake/options/options.rb +315 -310
- data/lib/bake/options/showDoc.rb +20 -20
- data/lib/bake/options/showLicense.rb +9 -9
- data/lib/bake/options/showToolchains.rb +38 -38
- data/lib/bake/options/usage.rb +79 -68
- data/lib/bake/subst.rb +313 -313
- data/lib/bake/toolchain/clang.rb +44 -44
- data/lib/bake/toolchain/clang_analyze.rb +31 -31
- data/lib/bake/toolchain/colorizing_formatter.rb +125 -125
- data/lib/bake/toolchain/diab.rb +53 -53
- data/lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb +40 -40
- data/lib/bake/toolchain/errorparser/diab_linker_error_parser.rb +41 -41
- data/lib/bake/toolchain/errorparser/error_parser.rb +71 -71
- data/lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb +35 -35
- data/lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb +35 -35
- data/lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb +32 -32
- data/lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb +44 -44
- data/lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb +40 -40
- data/lib/bake/toolchain/errorparser/keil_linker_error_parser.rb +30 -30
- data/lib/bake/toolchain/errorparser/lint_error_parser.rb +34 -34
- data/lib/bake/toolchain/errorparser/msvc_compiler_error_parser.rb +63 -63
- data/lib/bake/toolchain/errorparser/msvc_linker_error_parser.rb +42 -42
- data/lib/bake/toolchain/errorparser/process_output.rb +2 -2
- data/lib/bake/toolchain/errorparser/ti_compiler_error_parser.rb +30 -30
- data/lib/bake/toolchain/errorparser/ti_linker_error_parser.rb +30 -30
- data/lib/bake/toolchain/gcc.rb +49 -49
- data/lib/bake/toolchain/gcc_env.rb +55 -55
- data/lib/bake/toolchain/greenhills.rb +52 -52
- data/lib/bake/toolchain/keil.rb +53 -53
- data/lib/bake/toolchain/lint.rb +20 -20
- data/lib/bake/toolchain/msvc.rb +58 -58
- data/lib/bake/toolchain/provider.rb +146 -146
- data/lib/bake/toolchain/ti.rb +47 -47
- data/lib/bake/util.rb +149 -149
- data/lib/bakery/buildPattern.rb +24 -24
- data/lib/bakery/model/language.rb +22 -22
- data/lib/bakery/model/loader.rb +55 -55
- data/lib/bakery/model/metamodel.rb +48 -48
- data/lib/bakery/options/options.rb +87 -87
- data/lib/bakery/toBake.rb +81 -81
- data/lib/blocks/block.rb +324 -324
- data/lib/blocks/blockBase.rb +204 -204
- data/lib/blocks/commandLine.rb +38 -38
- data/lib/blocks/compile.rb +529 -528
- data/lib/blocks/convert.rb +41 -41
- data/lib/blocks/docu.rb +30 -30
- data/lib/blocks/executable.rb +174 -174
- data/lib/blocks/has_execute_command.rb +31 -31
- data/lib/blocks/library.rb +114 -114
- data/lib/blocks/lint.rb +56 -56
- data/lib/blocks/makefile.rb +100 -100
- data/lib/blocks/showIncludes.rb +140 -125
- data/lib/common/abortException.rb +4 -4
- data/lib/common/cleanup.rb +10 -10
- data/lib/common/exit_helper.rb +38 -38
- data/lib/common/ext/file.rb +88 -88
- data/lib/common/ext/rtext.rb +11 -11
- data/lib/common/ext/stdout.rb +45 -45
- data/lib/common/ide_interface.rb +194 -194
- data/lib/common/options/parser.rb +95 -85
- data/lib/common/process.rb +64 -64
- data/lib/common/utils.rb +52 -52
- data/lib/common/version.rb +31 -23
- data/lib/multithread/job.rb +44 -44
- data/lib/tocxx.rb +558 -555
- data/lib/vs/options.rb +69 -69
- data/license.txt +90 -90
- metadata +2 -2
@@ -1,143 +1,143 @@
|
|
1
|
-
Adapt configs
|
2
|
-
=============
|
3
|
-
|
4
|
-
Introduction
|
5
|
-
************
|
6
|
-
|
7
|
-
If you want to manipulate existing configs without changing them, you can "adapt" them via command line.
|
8
|
-
|
9
|
-
.. code-block:: console
|
10
|
-
|
11
|
-
User@Host:~$ bake test --adapt abc
|
12
|
-
|
13
|
-
bake searches for abc/Adapt.meta within the workspace roots. If found, the configs from the adapt file are parsed:
|
14
|
-
|
15
|
-
.. code-block:: text
|
16
|
-
|
17
|
-
Adapt {
|
18
|
-
ExecutableConfig ... # 0..n
|
19
|
-
LibraryConfig ... # 0..n
|
20
|
-
CustomConfig ... # 0..n
|
21
|
-
}
|
22
|
-
|
23
|
-
Here is an example to change the DefaultToolchain
|
24
|
-
|
25
|
-
.. code-block:: text
|
26
|
-
|
27
|
-
Adapt {
|
28
|
-
ExecutableConfig test, project: __MAIN__, type: replace {
|
29
|
-
DefaultToolchain GCC
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
Effectiveness
|
34
|
-
*************
|
35
|
-
|
36
|
-
The adapt configs can be applied to all configs from regular build. This can be controlled by the config names and the project attributes. The example above
|
37
|
-
is adapted only to the config "test" of the main project. __MAIN__ and __ALL__ are keywords. __MAIN__ means the main project or config, __ALL__ means all
|
38
|
-
projects or configs. If you want to apply the changes only to the top level config, write:
|
39
|
-
|
40
|
-
.. code-block:: text
|
41
|
-
|
42
|
-
ExecutableConfig __MAIN__, project: __MAIN__, ...
|
43
|
-
|
44
|
-
If you want to apply the changes to all configs, write:
|
45
|
-
|
46
|
-
.. code-block:: text
|
47
|
-
|
48
|
-
ExecutableConfig __ALL__, project: __ALL__, ...
|
49
|
-
|
50
|
-
It is possible to mix the keywords with reals project or config names.
|
51
|
-
|
52
|
-
Occurrences
|
53
|
-
***********
|
54
|
-
|
55
|
-
You can specify more configs in one adapt file and you can specify more than one adapt file:
|
56
|
-
|
57
|
-
.. code-block:: text
|
58
|
-
|
59
|
-
Adapt {
|
60
|
-
ExecutableConfig ..., project: ..., type: ... {
|
61
|
-
...
|
62
|
-
}
|
63
|
-
ExecutableConfig ..., project: ..., type: ... {
|
64
|
-
...
|
65
|
-
}
|
66
|
-
LibraryConfig ..., project: ..., type: ... {
|
67
|
-
...
|
68
|
-
}
|
69
|
-
...
|
70
|
-
}
|
71
|
-
|
72
|
-
.. code-block:: console
|
73
|
-
|
74
|
-
User@Host:~$ bake test --adapt abc --adapt xy
|
75
|
-
|
76
|
-
They will be applied in the specified order.
|
77
|
-
|
78
|
-
Types
|
79
|
-
*****
|
80
|
-
|
81
|
-
It is possible to specify the type of adaption:
|
82
|
-
|
83
|
-
.. code-block:: text
|
84
|
-
|
85
|
-
ExecutableConfig ..., type: replace
|
86
|
-
|
87
|
-
The type can be "replace", "remove" or "extend".
|
88
|
-
|
89
|
-
Type: extend
|
90
|
-
------------
|
91
|
-
|
92
|
-
This works exactly like for :doc:`derive_configs`.
|
93
|
-
|
94
|
-
Type: remove
|
95
|
-
------------
|
96
|
-
|
97
|
-
If parent elements can be found which matches to the child elements, they will be removed.
|
98
|
-
|
99
|
-
Example project config:
|
100
|
-
|
101
|
-
.. code-block:: text
|
102
|
-
|
103
|
-
ExecutableConfig test {
|
104
|
-
DefaultToolchain GCC
|
105
|
-
}
|
106
|
-
|
107
|
-
Example adapt configs:
|
108
|
-
|
109
|
-
.. code-block:: text
|
110
|
-
|
111
|
-
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
112
|
-
DefaultToolchain # remove ok
|
113
|
-
}
|
114
|
-
|
115
|
-
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
116
|
-
DefaultToolchain GCC # remove ok
|
117
|
-
}
|
118
|
-
|
119
|
-
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
120
|
-
DefaultToolchain Diab # remove NOT ok
|
121
|
-
}
|
122
|
-
|
123
|
-
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
124
|
-
DefaultToolchain GCC, eclipseOrder: true # remove NOT ok
|
125
|
-
}
|
126
|
-
|
127
|
-
Type: replace
|
128
|
-
-------------
|
129
|
-
|
130
|
-
This is for convenience. "replace" will remove all elements with the same type and extends the configs.
|
131
|
-
|
132
|
-
Example:
|
133
|
-
|
134
|
-
.. code-block:: text
|
135
|
-
|
136
|
-
ExecutableConfig __ALL__, project: __ALL__, type: replace {
|
137
|
-
Files "*.cpp"
|
138
|
-
DefaultToolchain GCC {
|
139
|
-
Linker command: "link.exe"
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
This removes all "Files" and the "DefaultToolchain" from the original config regardless their attributes and replaces them by the elements of the adapt config.
|
1
|
+
Adapt configs
|
2
|
+
=============
|
3
|
+
|
4
|
+
Introduction
|
5
|
+
************
|
6
|
+
|
7
|
+
If you want to manipulate existing configs without changing them, you can "adapt" them via command line.
|
8
|
+
|
9
|
+
.. code-block:: console
|
10
|
+
|
11
|
+
User@Host:~$ bake test --adapt abc
|
12
|
+
|
13
|
+
bake searches for abc/Adapt.meta within the workspace roots. If found, the configs from the adapt file are parsed:
|
14
|
+
|
15
|
+
.. code-block:: text
|
16
|
+
|
17
|
+
Adapt {
|
18
|
+
ExecutableConfig ... # 0..n
|
19
|
+
LibraryConfig ... # 0..n
|
20
|
+
CustomConfig ... # 0..n
|
21
|
+
}
|
22
|
+
|
23
|
+
Here is an example to change the DefaultToolchain
|
24
|
+
|
25
|
+
.. code-block:: text
|
26
|
+
|
27
|
+
Adapt {
|
28
|
+
ExecutableConfig test, project: __MAIN__, type: replace {
|
29
|
+
DefaultToolchain GCC
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
Effectiveness
|
34
|
+
*************
|
35
|
+
|
36
|
+
The adapt configs can be applied to all configs from regular build. This can be controlled by the config names and the project attributes. The example above
|
37
|
+
is adapted only to the config "test" of the main project. __MAIN__ and __ALL__ are keywords. __MAIN__ means the main project or config, __ALL__ means all
|
38
|
+
projects or configs. If you want to apply the changes only to the top level config, write:
|
39
|
+
|
40
|
+
.. code-block:: text
|
41
|
+
|
42
|
+
ExecutableConfig __MAIN__, project: __MAIN__, ...
|
43
|
+
|
44
|
+
If you want to apply the changes to all configs, write:
|
45
|
+
|
46
|
+
.. code-block:: text
|
47
|
+
|
48
|
+
ExecutableConfig __ALL__, project: __ALL__, ...
|
49
|
+
|
50
|
+
It is possible to mix the keywords with reals project or config names.
|
51
|
+
|
52
|
+
Occurrences
|
53
|
+
***********
|
54
|
+
|
55
|
+
You can specify more configs in one adapt file and you can specify more than one adapt file:
|
56
|
+
|
57
|
+
.. code-block:: text
|
58
|
+
|
59
|
+
Adapt {
|
60
|
+
ExecutableConfig ..., project: ..., type: ... {
|
61
|
+
...
|
62
|
+
}
|
63
|
+
ExecutableConfig ..., project: ..., type: ... {
|
64
|
+
...
|
65
|
+
}
|
66
|
+
LibraryConfig ..., project: ..., type: ... {
|
67
|
+
...
|
68
|
+
}
|
69
|
+
...
|
70
|
+
}
|
71
|
+
|
72
|
+
.. code-block:: console
|
73
|
+
|
74
|
+
User@Host:~$ bake test --adapt abc --adapt xy
|
75
|
+
|
76
|
+
They will be applied in the specified order.
|
77
|
+
|
78
|
+
Types
|
79
|
+
*****
|
80
|
+
|
81
|
+
It is possible to specify the type of adaption:
|
82
|
+
|
83
|
+
.. code-block:: text
|
84
|
+
|
85
|
+
ExecutableConfig ..., type: replace
|
86
|
+
|
87
|
+
The type can be "replace", "remove" or "extend".
|
88
|
+
|
89
|
+
Type: extend
|
90
|
+
------------
|
91
|
+
|
92
|
+
This works exactly like for :doc:`derive_configs`.
|
93
|
+
|
94
|
+
Type: remove
|
95
|
+
------------
|
96
|
+
|
97
|
+
If parent elements can be found which matches to the child elements, they will be removed.
|
98
|
+
|
99
|
+
Example project config:
|
100
|
+
|
101
|
+
.. code-block:: text
|
102
|
+
|
103
|
+
ExecutableConfig test {
|
104
|
+
DefaultToolchain GCC
|
105
|
+
}
|
106
|
+
|
107
|
+
Example adapt configs:
|
108
|
+
|
109
|
+
.. code-block:: text
|
110
|
+
|
111
|
+
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
112
|
+
DefaultToolchain # remove ok
|
113
|
+
}
|
114
|
+
|
115
|
+
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
116
|
+
DefaultToolchain GCC # remove ok
|
117
|
+
}
|
118
|
+
|
119
|
+
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
120
|
+
DefaultToolchain Diab # remove NOT ok
|
121
|
+
}
|
122
|
+
|
123
|
+
ExecutableConfig __ALL__, project: __ALL__, type: remove {
|
124
|
+
DefaultToolchain GCC, eclipseOrder: true # remove NOT ok
|
125
|
+
}
|
126
|
+
|
127
|
+
Type: replace
|
128
|
+
-------------
|
129
|
+
|
130
|
+
This is for convenience. "replace" will remove all elements with the same type and extends the configs.
|
131
|
+
|
132
|
+
Example:
|
133
|
+
|
134
|
+
.. code-block:: text
|
135
|
+
|
136
|
+
ExecutableConfig __ALL__, project: __ALL__, type: replace {
|
137
|
+
Files "*.cpp"
|
138
|
+
DefaultToolchain GCC {
|
139
|
+
Linker command: "link.exe"
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
This removes all "Files" and the "DefaultToolchain" from the original config regardless their attributes and replaces them by the elements of the adapt config.
|
@@ -1,43 +1,43 @@
|
|
1
|
-
Auto-adjustment of paths to existing projects
|
2
|
-
=============================================
|
3
|
-
|
4
|
-
If paths to other projects are needed, e.g. to "bootloaderUpdater", don't write a hard coded relative path like this:
|
5
|
-
|
6
|
-
.. code-block:: text
|
7
|
-
|
8
|
-
CommandLine "../bootloaderUpdater/tools/PrimaryBootloader2Include.exe
|
9
|
-
|
10
|
-
If paths to other projects are needed, e.g. to "bootloaderUpdater" just reference it starting from the project folder.
|
11
|
-
|
12
|
-
Example:
|
13
|
-
|
14
|
-
.. code-block:: text
|
15
|
-
|
16
|
-
CommandLine "bootloaderUpdater/tools/PrimaryBootloader2Include.exe
|
17
|
-
|
18
|
-
or:
|
19
|
-
|
20
|
-
.. code-block:: text
|
21
|
-
|
22
|
-
IncludeDir "myProjectName/bootloaderUpdater/whatever"
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
bake recognizes that the first part of the path is a valid project name and calculates the relative path to the project automatically.
|
27
|
-
If you have the special case that the referenced project is contained in an other workspace root, you can use the
|
28
|
-
`-w` parameter or you define a `roots.bake`.
|
29
|
-
|
30
|
-
.. note::
|
31
|
-
|
32
|
-
The path auto adjustment is applied for the following elements:
|
33
|
-
|
34
|
-
* IncludeDir
|
35
|
-
|
36
|
-
* ExternalLibrary
|
37
|
-
|
38
|
-
* ExternalLibrarySearchPath
|
39
|
-
|
40
|
-
* UserLibrary
|
41
|
-
|
42
|
-
* CommandLine
|
43
|
-
|
1
|
+
Auto-adjustment of paths to existing projects
|
2
|
+
=============================================
|
3
|
+
|
4
|
+
If paths to other projects are needed, e.g. to "bootloaderUpdater", don't write a hard coded relative path like this:
|
5
|
+
|
6
|
+
.. code-block:: text
|
7
|
+
|
8
|
+
CommandLine "../bootloaderUpdater/tools/PrimaryBootloader2Include.exe
|
9
|
+
|
10
|
+
If paths to other projects are needed, e.g. to "bootloaderUpdater" just reference it starting from the project folder.
|
11
|
+
|
12
|
+
Example:
|
13
|
+
|
14
|
+
.. code-block:: text
|
15
|
+
|
16
|
+
CommandLine "bootloaderUpdater/tools/PrimaryBootloader2Include.exe
|
17
|
+
|
18
|
+
or:
|
19
|
+
|
20
|
+
.. code-block:: text
|
21
|
+
|
22
|
+
IncludeDir "myProjectName/bootloaderUpdater/whatever"
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
bake recognizes that the first part of the path is a valid project name and calculates the relative path to the project automatically.
|
27
|
+
If you have the special case that the referenced project is contained in an other workspace root, you can use the
|
28
|
+
`-w` parameter or you define a `roots.bake`.
|
29
|
+
|
30
|
+
.. note::
|
31
|
+
|
32
|
+
The path auto adjustment is applied for the following elements:
|
33
|
+
|
34
|
+
* IncludeDir
|
35
|
+
|
36
|
+
* ExternalLibrary
|
37
|
+
|
38
|
+
* ExternalLibrarySearchPath
|
39
|
+
|
40
|
+
* UserLibrary
|
41
|
+
|
42
|
+
* CommandLine
|
43
|
+
|
@@ -1,94 +1,93 @@
|
|
1
|
-
Derive configs
|
2
|
-
==============
|
3
|
-
|
4
|
-
bake supports deriving configs, which allows you to put repetetive settings in a base config.
|
5
|
-
|
6
|
-
Deriving a config
|
7
|
-
*****************
|
8
|
-
|
9
|
-
Derving a config in bake is pretty straight forward, and looks like this:
|
10
|
-
|
11
|
-
.. code-block:: text
|
12
|
-
|
13
|
-
ExecutableConfig A
|
14
|
-
LibraryConfig B, extends: A
|
15
|
-
CustomConfig C, extends: B
|
16
|
-
ExecutableConfig D, extends: C
|
17
|
-
|
18
|
-
.. note::
|
19
|
-
|
20
|
-
The config type of the parent config does not matter, but only settings which are valid in BOTH configs will be inherited.
|
21
|
-
In the example above D gets the dependencies from A, because "Dependency" is valid in all configs, but D does not get
|
22
|
-
the "Files" from A and B, because "Files" is not valid in CustomConfig.
|
23
|
-
|
24
|
-
|
25
|
-
Inheritance implications
|
26
|
-
************************
|
27
|
-
|
28
|
-
In general it is very easy.
|
29
|
-
|
30
|
-
- Elements which can exist more than once (e.g. "Files"), are simply concatenated. First the parent elements, then the client elements.
|
31
|
-
- Elements which can exist only once:
|
32
|
-
|
33
|
-
- if it exists in EITHER child OR parent, use this one
|
34
|
-
- is it exists in BOTH, attributes are merged (child attributes have high priority) and sub elements are inherited recursively
|
35
|
-
|
36
|
-
The following example
|
37
|
-
|
38
|
-
.. code-block:: text
|
39
|
-
|
40
|
-
ExecutableConfig A {
|
41
|
-
Files "x.cpp"
|
42
|
-
Files "y.cpp"
|
43
|
-
ArtifactName "z.exe"
|
44
|
-
DefaultToolchain GCC {
|
45
|
-
Linker {
|
46
|
-
Flags "-O3"
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
ExecutableConfig B, extends: A {
|
51
|
-
Files "z.cpp"
|
52
|
-
IncludeDir "inc"
|
53
|
-
ArtifactName "a.exe"
|
54
|
-
DefaultToolchain Diab {
|
55
|
-
Compiler CPP {
|
56
|
-
Define "TEST"
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
results implicitly in:
|
62
|
-
|
63
|
-
.. code-block:: text
|
64
|
-
|
65
|
-
ExecutableConfig B {
|
66
|
-
Files "x.cpp"
|
67
|
-
Files "y.cpp"
|
68
|
-
Files "z.cpp"
|
69
|
-
IncludeDir "inc"
|
70
|
-
ArtifactName "a.exe"
|
71
|
-
DefaultToolchain Diab {
|
72
|
-
Compiler CPP {
|
73
|
-
Define "TEST"
|
74
|
-
}
|
75
|
-
Linker {
|
76
|
-
Flags "-O3"
|
77
|
-
}
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
|
82
|
-
Multiple inheritance
|
83
|
-
********************
|
84
|
-
|
85
|
-
It is possible to derive from several projects:
|
86
|
-
|
87
|
-
.. code-block:: text
|
88
|
-
|
89
|
-
ExecutableConfig A
|
90
|
-
LibraryConfig B
|
91
|
-
ExecutableConfig C, extends: "A, B"
|
92
|
-
|
93
|
-
"extends" defines a comma separated list. The merge will be performed with all parent configs.
|
94
|
-
|
1
|
+
Derive configs
|
2
|
+
==============
|
3
|
+
|
4
|
+
bake supports deriving configs, which allows you to put repetetive settings in a base config.
|
5
|
+
|
6
|
+
Deriving a config
|
7
|
+
*****************
|
8
|
+
|
9
|
+
Derving a config in bake is pretty straight forward, and looks like this:
|
10
|
+
|
11
|
+
.. code-block:: text
|
12
|
+
|
13
|
+
ExecutableConfig A
|
14
|
+
LibraryConfig B, extends: A
|
15
|
+
CustomConfig C, extends: B
|
16
|
+
ExecutableConfig D, extends: C
|
17
|
+
|
18
|
+
.. note::
|
19
|
+
|
20
|
+
The config type of the parent config does not matter, but only settings which are valid in BOTH configs will be inherited.
|
21
|
+
In the example above D gets the dependencies from A, because "Dependency" is valid in all configs, but D does not get
|
22
|
+
the "Files" from A and B, because "Files" is not valid in CustomConfig.
|
23
|
+
|
24
|
+
|
25
|
+
Inheritance implications
|
26
|
+
************************
|
27
|
+
|
28
|
+
In general it is very easy.
|
29
|
+
|
30
|
+
- Elements which can exist more than once (e.g. "Files"), are simply concatenated. First the parent elements, then the client elements.
|
31
|
+
- Elements which can exist only once:
|
32
|
+
|
33
|
+
- if it exists in EITHER child OR parent, use this one
|
34
|
+
- is it exists in BOTH, attributes are merged (child attributes have high priority) and sub elements are inherited recursively
|
35
|
+
|
36
|
+
The following example
|
37
|
+
|
38
|
+
.. code-block:: text
|
39
|
+
|
40
|
+
ExecutableConfig A {
|
41
|
+
Files "x.cpp"
|
42
|
+
Files "y.cpp"
|
43
|
+
ArtifactName "z.exe"
|
44
|
+
DefaultToolchain GCC {
|
45
|
+
Linker {
|
46
|
+
Flags "-O3"
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
ExecutableConfig B, extends: A {
|
51
|
+
Files "z.cpp"
|
52
|
+
IncludeDir "inc"
|
53
|
+
ArtifactName "a.exe"
|
54
|
+
DefaultToolchain Diab {
|
55
|
+
Compiler CPP {
|
56
|
+
Define "TEST"
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
results implicitly in:
|
62
|
+
|
63
|
+
.. code-block:: text
|
64
|
+
|
65
|
+
ExecutableConfig B {
|
66
|
+
Files "x.cpp"
|
67
|
+
Files "y.cpp"
|
68
|
+
Files "z.cpp"
|
69
|
+
IncludeDir "inc"
|
70
|
+
ArtifactName "a.exe"
|
71
|
+
DefaultToolchain Diab {
|
72
|
+
Compiler CPP {
|
73
|
+
Define "TEST"
|
74
|
+
}
|
75
|
+
Linker {
|
76
|
+
Flags "-O3"
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
Multiple inheritance
|
83
|
+
********************
|
84
|
+
|
85
|
+
It is possible to derive from several projects:
|
86
|
+
|
87
|
+
.. code-block:: text
|
88
|
+
|
89
|
+
ExecutableConfig A
|
90
|
+
LibraryConfig B
|
91
|
+
ExecutableConfig C, extends: "A, B"
|
92
|
+
|
93
|
+
"extends" defines a comma separated list. The merge will be performed with all parent configs.
|