50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'lib/bake/config/checks.rb', line 50
def self.commonMetamodelCheck(configs, filename, isAdapt = false)
if configs.length == 0 && !isAdapt
Bake.formatter.printError("No config found", filename)
ExitHelper.exit(1)
end
configs.each do |config|
if config.respond_to?("toolchain") and config.toolchain
config.toolchain.compiler.each do |c|
if [:CPP,:C,:ASM].none? {|t| t == c.ctype}
Bake.formatter.printError("Type of compiler must be CPP, C or ASM", c)
ExitHelper.exit(1)
end
if not c.internalDefines.nil? and c.internalDefines != ""
Bake.formatter.printError("InternalDefines only allowed in DefaultToolchain", c.internalDefines)
ExitHelper.exit(1)
end
if c.fileEndings && c.fileEndings.endings.empty?
Bake.formatter.printError("FileEnding must not be empty.", c.fileEndings)
ExitHelper.exit(1)
end
end
config.toolchain.lintPolicy.each do |l|
Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
end
end
if config.respond_to?("defaultToolchain") and config.defaultToolchain
config.defaultToolchain.lintPolicy.each do |l|
Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
end
config.defaultToolchain.compiler.each do |c|
if [:CPP,:C,:ASM].none? {|t| t == c.ctype}
Bake.formatter.printError("Type of compiler must be CPP, C or ASM", c)
ExitHelper.exit(1)
end
if c.fileEndings && c.fileEndings.endings.empty?
Bake.formatter.printError("FileEnding must not be empty.", c.fileEndings)
ExitHelper.exit(1)
end
end
end
config.includeDir.each do |inc|
if not ["front", "back", ""].include?inc.inject
Bake.formatter.printError("inject of IncludeDir must be 'front' or 'back'", inc)
ExitHelper.exit(1)
end
if not ["front", "back", ""].include?inc.infix
Bake.formatter.printError("infix of IncludeDir must be 'front' or 'back'", inc)
ExitHelper.exit(1)
end
if (inc.infix != "" and inc.inject != "")
Bake.formatter.printError("IncludeDir must have inject OR infix (deprecated)", inc)
ExitHelper.exit(1)
end
if (inc.name.empty? || inc.name[0] == " ")
Bake.formatter.printError("IncludeDir must not be empty or start with a space", inc)
ExitHelper.exit(1)
end
end if config.respond_to?("includeDir")
if not ["", "yes", "no", "all"].include?config.mergeInc
Bake.formatter.printError("Allowed modes are 'all', 'yes', 'no' and unset.",config)
ExitHelper.exit(1)
end
end
end
|