bake-toolkit 2.64.3 → 2.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bake/config/loader.rb +9 -8
- data/lib/bake/model/loader.rb +4 -2
- data/lib/bake/toolchain/clang.rb +3 -0
- data/lib/bake/toolchain/clang_bitcode.rb +34 -0
- data/lib/bake/toolchain/provider.rb +2 -0
- data/lib/blocks/block.rb +1 -0
- data/lib/blocks/compile.rb +8 -4
- data/lib/blocks/library.rb +4 -1
- data/lib/blocks/makefile.rb +4 -2
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +9 -5
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa60204c2439429e2b1d8e42d36206941185d1085f5c59390b8e5552f6549893
|
4
|
+
data.tar.gz: 5cfa793f77484f38e0170995b40b679fbd4367f3ef06c50c86c5cc148aacc9cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6901da13b1b992c9e99af33b82f4dc0841d3d236e376a8a6932ba9d1d40490a98f283d0c6aacc794881703fea09b147f353e24b7c5790329cee56d44c0b9bf97
|
7
|
+
data.tar.gz: 93edb29bd48e1752ebe1d29e83916309fd291e69701b30e9deadfb9f58dc8507bffdb2da7474fcce7336de9f08275017759092b46528c9db793033e2795f0a9e
|
data/lib/bake/config/loader.rb
CHANGED
@@ -26,8 +26,7 @@ module Bake
|
|
26
26
|
return configname
|
27
27
|
end
|
28
28
|
|
29
|
-
def getFullProjectInternal(configs, configname, isMain) # note: configs is never empty
|
30
|
-
|
29
|
+
def getFullProjectInternal(configs, configname, isMain, extendStack) # note: configs is never empty
|
31
30
|
configname = resolveConfigName(configs, configname)
|
32
31
|
|
33
32
|
if isMain
|
@@ -60,7 +59,11 @@ module Bake
|
|
60
59
|
if config.extends != ""
|
61
60
|
config.extends.split(",").map {|ex| ex.strip}.reverse.each do |ex|
|
62
61
|
if (ex != "")
|
63
|
-
|
62
|
+
if extendStack.include?(ex)
|
63
|
+
Bake.formatter.printError("Config extends to circular loop: #{(extendStack << ex).join("->")}", configs[0].file_name)
|
64
|
+
ExitHelper.exit(1)
|
65
|
+
end
|
66
|
+
parent,parentConfigName = getFullProjectInternal(configs, ex, isMain, extendStack << ex)
|
64
67
|
MergeConfig.new(config, parent).merge(:merge)
|
65
68
|
end
|
66
69
|
end
|
@@ -70,15 +73,13 @@ module Bake
|
|
70
73
|
end
|
71
74
|
|
72
75
|
def getFullProject(projName, configs, configname, isMain)
|
73
|
-
|
74
|
-
|
75
76
|
configname = resolveConfigName(configs, configname)
|
76
77
|
|
77
78
|
if @fullProjects.has_key?(projName + "," + configname)
|
78
79
|
return @fullProjects[projName + "," + configname]
|
79
80
|
end
|
80
81
|
|
81
|
-
config, configname = getFullProjectInternal(configs, configname, isMain)
|
82
|
+
config, configname = getFullProjectInternal(configs, configname, isMain, [configname])
|
82
83
|
|
83
84
|
if isMain
|
84
85
|
@defaultToolchainName = config.defaultToolchain.basedOn unless config.defaultToolchain.nil?
|
@@ -116,7 +117,7 @@ module Bake
|
|
116
117
|
configHash[s.name] += s.value.split(";")
|
117
118
|
end
|
118
119
|
|
119
|
-
if !isMain
|
120
|
+
if !isMain && @configHashMain
|
120
121
|
@configHashMain.each do |k,v|
|
121
122
|
if configHash.has_key?(k)
|
122
123
|
configHash[k] += v
|
@@ -237,7 +238,7 @@ module Bake
|
|
237
238
|
if adaptRoots.length > 0
|
238
239
|
adaptRoots.each do |adapt|
|
239
240
|
Bake::Config::checkVer(adapt.requiredBakeVersion)
|
240
|
-
adapt.mainProject =
|
241
|
+
adapt.mainProject = proj.name if adapt.mainProject == "__THIS__"
|
241
242
|
adaptConfigs = adapt.getConfig
|
242
243
|
AdaptConfig.checkSyntax(adaptConfigs, filename, true)
|
243
244
|
adaptConfigs.each do |ac|
|
data/lib/bake/model/loader.rb
CHANGED
@@ -113,7 +113,8 @@ module Bake
|
|
113
113
|
applyFilterOnElement(elem)
|
114
114
|
end
|
115
115
|
end
|
116
|
-
toRemove.each { |r| r.parent = nil }
|
116
|
+
toRemove.each { |r| r.parent = nil if r.respond_to?(:parent=) }
|
117
|
+
return toRemove
|
117
118
|
end
|
118
119
|
|
119
120
|
def applyFilterOnElement(elem)
|
@@ -167,7 +168,8 @@ module Bake
|
|
167
168
|
ExitHelper.exit(1)
|
168
169
|
end
|
169
170
|
|
170
|
-
applyFilterOnArray(frag.root_elements)
|
171
|
+
tor = applyFilterOnArray(frag.root_elements)
|
172
|
+
frag.root_elements.delete_if {|re| tor.include?(re)}
|
171
173
|
|
172
174
|
return frag
|
173
175
|
|
data/lib/bake/toolchain/clang.rb
CHANGED
@@ -32,6 +32,9 @@ module Bake
|
|
32
32
|
if Bake::Utils::OS::name == "Mac"
|
33
33
|
CLANG_CHAIN[:ARCHIVER][:COMMAND] = "libtool"
|
34
34
|
CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-static -o"
|
35
|
+
elsif Bake::Utils::OS::name == "Windows"
|
36
|
+
CLANG_CHAIN[:ARCHIVER][:COMMAND] = "clang"
|
37
|
+
CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-fuse-ld=llvm-lib -o"
|
35
38
|
else
|
36
39
|
CLANG_CHAIN[:ARCHIVER][:COMMAND] = "ar"
|
37
40
|
CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "r"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative'../../common/utils'
|
2
|
+
require_relative '../toolchain/provider'
|
3
|
+
require_relative '../toolchain/errorparser/error_parser'
|
4
|
+
require_relative '../toolchain/errorparser/gcc_compiler_error_parser'
|
5
|
+
require_relative '../toolchain/errorparser/gcc_linker_error_parser'
|
6
|
+
|
7
|
+
module Bake
|
8
|
+
module Toolchain
|
9
|
+
CLANG_BITCODE_CHAIN = Provider.add("CLANG_BITCODE")
|
10
|
+
|
11
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:CPP].update({
|
12
|
+
:COMMAND => "clang++",
|
13
|
+
:DEFINE_FLAG => "-D",
|
14
|
+
:OBJECT_FILE_FLAG => "-o",
|
15
|
+
:OBJ_FLAG_SPACE => true,
|
16
|
+
:OBJECT_FILE_ENDING => ".bc",
|
17
|
+
:COMPILE_FLAGS => "-emit-llvm -c ",
|
18
|
+
:ERROR_PARSER => nil,
|
19
|
+
:DEP_FLAGS => "-MD -MF",
|
20
|
+
:DEP_FLAGS_SPACE => true,
|
21
|
+
})
|
22
|
+
|
23
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C] = Utils.deep_copy(CLANG_BITCODE_CHAIN[:COMPILER][:CPP])
|
24
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:C][:SOURCE_FILE_ENDINGS]
|
25
|
+
CLANG_BITCODE_CHAIN[:COMPILER][:C][:COMMAND] = "clang"
|
26
|
+
|
27
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:COMMAND] = "llvm-link"
|
28
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-o"
|
29
|
+
CLANG_BITCODE_CHAIN[:ARCHIVER][:ARCHIVE_FILE_ENDING] = ".bc"
|
30
|
+
|
31
|
+
CLANG_BITCODE_CHAIN[:LINKER][:COMMAND] = "llvm-link"
|
32
|
+
CLANG_BITCODE_CHAIN[:LINKER][:EXE_FLAG] = "-o"
|
33
|
+
end
|
34
|
+
end
|
@@ -88,6 +88,7 @@ module Bake
|
|
88
88
|
:PREFIX => "$(ArchiverPrefix)",
|
89
89
|
:ARCHIVE_FLAGS => "",
|
90
90
|
:ARCHIVE_FLAGS_SPACE => true,
|
91
|
+
:ARCHIVE_FILE_ENDING => ".a",
|
91
92
|
:FLAGS => "",
|
92
93
|
:ERROR_PARSER => nil,
|
93
94
|
:FILE_COMMAND => ""
|
@@ -163,6 +164,7 @@ require_relative '../toolchain/diab'
|
|
163
164
|
require_relative '../toolchain/gcc'
|
164
165
|
require_relative '../toolchain/clang'
|
165
166
|
require_relative '../toolchain/clang_analyze'
|
167
|
+
require_relative '../toolchain/clang_bitcode'
|
166
168
|
require_relative '../toolchain/ti'
|
167
169
|
require_relative '../toolchain/greenhills'
|
168
170
|
require_relative '../toolchain/keil'
|
data/lib/blocks/block.rb
CHANGED
data/lib/blocks/compile.rb
CHANGED
@@ -37,7 +37,7 @@ begin
|
|
37
37
|
x = longname(shortname(file))
|
38
38
|
end
|
39
39
|
|
40
|
-
rescue
|
40
|
+
rescue Exception
|
41
41
|
|
42
42
|
def realname file
|
43
43
|
file
|
@@ -133,14 +133,18 @@ module Bake
|
|
133
133
|
return false
|
134
134
|
end
|
135
135
|
|
136
|
+
def calcObjectBasename(object)
|
137
|
+
object.chomp(File.extname(object))
|
138
|
+
end
|
139
|
+
|
136
140
|
def calcCmdlineFile(object)
|
137
|
-
File.expand_path(object
|
141
|
+
File.expand_path(calcObjectBasename(object) + ".cmdline", @projectDir)
|
138
142
|
end
|
139
143
|
|
140
144
|
def calcDepFile(object, type)
|
141
145
|
dep_filename = nil
|
142
146
|
if type != :ASM
|
143
|
-
dep_filename = object
|
147
|
+
dep_filename = calcObjectBasename(object) + ".d"
|
144
148
|
end
|
145
149
|
dep_filename
|
146
150
|
end
|
@@ -561,7 +565,7 @@ module Bake
|
|
561
565
|
pr = sources.name
|
562
566
|
pr = pr[2..-1] if pr.start_with?"./"
|
563
567
|
|
564
|
-
res = Dir.glob_dir(pr, @projectDir).sort
|
568
|
+
res = Dir.glob_dir(pr, @projectDir).select {|f| !get_source_type(f).nil?}.sort
|
565
569
|
if res.length == 0 and cleaning == false
|
566
570
|
if not pr.include?"*" and not pr.include?"?"
|
567
571
|
Bake.formatter.printError("Source file '#{pr}' not found", sources)
|
data/lib/blocks/library.rb
CHANGED
@@ -18,10 +18,13 @@ module Bake
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def calcArtifactName
|
21
|
+
archiver = @block.tcs[:ARCHIVER]
|
22
|
+
fileEnding = archiver[:ARCHIVE_FILE_ENDING]
|
23
|
+
|
21
24
|
if not @config.artifactName.nil? and @config.artifactName.name != ""
|
22
25
|
baseFilename = @config.artifactName.name
|
23
26
|
else
|
24
|
-
baseFilename = "lib#{@projectName}
|
27
|
+
baseFilename = "lib#{@projectName}#{fileEnding}"
|
25
28
|
end
|
26
29
|
if !@config.artifactExtension.nil? && @config.artifactExtension.name != "default"
|
27
30
|
extension = ".#{@config.artifactExtension.name}"
|
data/lib/blocks/makefile.rb
CHANGED
@@ -17,14 +17,16 @@ module Bake
|
|
17
17
|
@projectDir = config.get_project_dir
|
18
18
|
@path_to = ""
|
19
19
|
@flags = adjustFlags("",config.flags) if config.flags
|
20
|
-
@makefile = config.name
|
20
|
+
@makefile = block.convPath(config.name)
|
21
21
|
@target = config.target != "" ? config.target : "all"
|
22
22
|
calcPathTo(referencedConfigs)
|
23
23
|
calcCommandLine
|
24
24
|
calcCleanLine
|
25
25
|
calcEnv
|
26
26
|
|
27
|
-
|
27
|
+
if config.lib != ""
|
28
|
+
block.lib_elements << LibElement.new(LibElement::LIB_WITH_PATH, block.convPath(config.lib))
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
def calcEnv
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -859,6 +859,7 @@ module Bake
|
|
859
859
|
!Bake.options.linkOnly &&
|
860
860
|
!Bake.options.prepro &&
|
861
861
|
!Bake.options.compileOnly &&
|
862
|
+
!Bake.options.dry &&
|
862
863
|
!Bake.options.clean
|
863
864
|
|
864
865
|
ccChecks = []
|
@@ -889,14 +890,17 @@ module Bake
|
|
889
890
|
b.source_files_compiled.each do |s|
|
890
891
|
inCompilation << File.expand_path(s, b.projectDir)
|
891
892
|
type = b.get_source_type(s)
|
892
|
-
if type != :ASM
|
893
|
+
if type != :ASM && b.object_files && b.object_files.has_key?(s)
|
893
894
|
o = b.object_files[s]
|
894
895
|
dep_filename = b.calcDepFile(o, type)
|
895
896
|
dep_filename_conv = b.calcDepFileConv(dep_filename)
|
896
|
-
File.
|
897
|
-
|
898
|
-
|
899
|
-
|
897
|
+
fname = File.expand_path(dep_filename_conv, b.projectDir)
|
898
|
+
if File.exist?(fname)
|
899
|
+
File.readlines(fname).map{|line| line.strip}.each do |dep|
|
900
|
+
header = File.expand_path(dep, b.projectDir)
|
901
|
+
if File.exist?(header)
|
902
|
+
inCompilation << header
|
903
|
+
end
|
900
904
|
end
|
901
905
|
end
|
902
906
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.66.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Schaal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: thwait
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.1.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.1.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: e2mmap
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- lib/bake/subst.rb
|
205
205
|
- lib/bake/toolchain/clang.rb
|
206
206
|
- lib/bake/toolchain/clang_analyze.rb
|
207
|
+
- lib/bake/toolchain/clang_bitcode.rb
|
207
208
|
- lib/bake/toolchain/colorizing_formatter.rb
|
208
209
|
- lib/bake/toolchain/diab.rb
|
209
210
|
- lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb
|