Skip to content

Commit b7a6231

Browse files
authored
[projmgr] Add environment node to cbuild-set (#1097)
1 parent a6e568a commit b7a6231

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

tools/projmgr/include/ProjMgrYamlParser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static constexpr const char* YAML_DEVICE_PACK = "device-pack";
8181
static constexpr const char* YAML_DOWNLOAD_URL = "download-url";
8282
static constexpr const char* YAML_DSP = "dsp";
8383
static constexpr const char* YAML_ENDIAN = "endian";
84+
static constexpr const char* YAML_ENVIRONMENT = "environment";
8485
static constexpr const char* YAML_ERRORS = "errors";
8586
static constexpr const char* YAML_EXECUTE = "execute";
8687
static constexpr const char* YAML_EXECUTES = "executes";

tools/projmgr/schemas/common.schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,11 @@
14901490
"properties": {
14911491
"generated-by": { "type": "string", "description": "Tool name along with version information used to generate this application." },
14921492
"contexts": { "$ref": "#/definitions/BuildSetContextsType", "description": "List of fully specified contexts." },
1493-
"compiler": { "type": "string", "description": "Selection of compiler used." }
1493+
"compiler": { "type": "string", "description": "Selection of compiler used." },
1494+
"environment": {
1495+
"description": "Environment specific settings.",
1496+
"additionalProperties": true
1497+
}
14941498
},
14951499
"additionalProperties": false,
14961500
"required": ["generated-by", "contexts"]

tools/projmgr/src/ProjMgr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,14 @@ bool ProjMgr::ParseAndValidateContexts() {
554554

555555
if (m_contextSet) {
556556
const auto& selectedContexts = m_worker.GetSelectedContexts();
557-
m_selectedToolchain = m_worker.GetSelectedToochain();
558557
if (!selectedContexts.empty()) {
559558
const string& cbuildSetFile = (m_outputDir.empty() ? m_parser.GetCsolution().directory : m_outputDir) + "/" +
560559
m_parser.GetCsolution().name + ".cbuild-set.yml";
561560
// Generate cbuild-set file
562-
if (!m_emitter.GenerateCbuildSet(selectedContexts, m_selectedToolchain, cbuildSetFile, m_checkSchema)) {
563-
return false;
561+
if (!m_context.empty() || !m_selectedToolchain.empty() || !RteFsUtils::Exists(cbuildSetFile)) {
562+
if (!m_emitter.GenerateCbuildSet(selectedContexts, m_selectedToolchain, cbuildSetFile, m_checkSchema)) {
563+
return false;
564+
}
564565
}
565566
}
566567
}

tools/projmgr/src/ProjMgrYamlParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,7 @@ const set<string> cbuildSetKeys = {
10691069
YAML_GENERATED_BY,
10701070
YAML_CONTEXTS,
10711071
YAML_COMPILER,
1072+
YAML_ENVIRONMENT,
10721073
};
10731074

10741075
const set<string> cbuildPackKeys = {

0 commit comments

Comments
 (0)