From acd3688d16d1b5205b313614d77cfd13b6da5fdc Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sun, 16 May 2021 22:51:42 +0200 Subject: [PATCH] Fix [fetch-content] --- src/cmake.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmake.cpp b/src/cmake.cpp index 9a2c2e1..70567c5 100644 --- a/src/cmake.cpp +++ b/src/cmake.cpp @@ -55,6 +55,7 @@ static void get_optional(const TomlBasicValue &v, const toml::key &ky, Condition template static void get_optional(const TomlBasicValue &v, const toml::key &ky, T &destination) { + // TODO: this currently doesn't allow you to get an optional map if (v.contains(ky)) { destination = toml::find(v, ky); } @@ -163,7 +164,9 @@ CMake::CMake(const std::string &path, bool build) { } // TODO: refactor to std::vector instead of this hacky thing? - get_optional(toml, "fetch-content", contents); + if (toml.contains("fetch-content")) { + contents = toml::find(toml, "fetch-content"); + } if (toml.contains("bin")) { throw std::runtime_error("[[bin]] has been renamed to [[target]]");