Skip to content

Commit 06a4c04

Browse files
committed
Add support for 'shallow' in fetch-content
1 parent fef2a02 commit 06a4c04

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/project_parser.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
370370
key = "GIT_REPOSITORY";
371371
} else if (key == "tag") {
372372
key = "GIT_TAG";
373+
} else if (key == "shallow") {
374+
key = "GIT_SHALLOW";
373375
} else if (key == "svn") {
374376
key = "SVN_REPOSITORY";
375377
} else if (key == "rev") {
@@ -381,7 +383,14 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
381383
} else {
382384
// don't change arg
383385
}
384-
content.arguments.emplace(key, argItr.second.as_string());
386+
387+
std::string value;
388+
if (argItr.second.is_boolean()) {
389+
value = argItr.second.as_boolean() ? "ON" : "OFF";
390+
} else {
391+
value = argItr.second.as_string();
392+
}
393+
content.arguments.emplace(key, value);
385394
}
386395
contents.emplace_back(std::move(content));
387396
}

0 commit comments

Comments
 (0)