Skip to content

Commit aaa0a63

Browse files
committed
Fix crosscompilation variable warning. Fix multiple subdir levels.
1 parent e67c1d5 commit aaa0a63

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/common/config.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ void Config::load(const yaml &root)
150150
if (!fs::exists(d))
151151
return;
152152

153+
auto tmp = subdir;
153154
subdir = d.filename().string();
154155
reload(d);
155-
subdir.clear();
156+
subdir = tmp;
156157

157158
for (auto &[s, p] : projects)
158159
rd.known_local_packages.insert(p.pkg);
@@ -174,9 +175,10 @@ void Config::load(const yaml &root)
174175
return;
175176
if (kv["load_all_packages"].IsDefined() && kv["load_all_packages"].as<bool>())
176177
{
178+
auto tmp = subdir;
177179
subdir = d.filename().string();
178180
reload(d);
179-
subdir.clear();
181+
subdir = tmp;
180182

181183
for (auto &[s, p] : projects)
182184
rd.known_local_packages.insert(p.pkg);

src/printers/cmake.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,8 @@ int CMakePrinter::generate(const BuildSettings &bs) const
12881288
c.args.push_back("-DCPPAN_HOST_C_COMPILER=" + s.host_c_compiler);
12891289
if (!s.host_cxx_compiler.empty())
12901290
c.args.push_back("-DCPPAN_HOST_CXX_COMPILER=" + s.host_cxx_compiler);
1291-
c.args.push_back("-DCPPAN_CROSSCOMPILATION="s + (s.crosscompilation ? "1" : "0"));
1291+
if (s.crosscompilation)
1292+
c.args.push_back("-DCPPAN_CROSSCOMPILATION="s + (s.crosscompilation ? "1" : "0"));
12921293
if (!s.generator.empty())
12931294
{
12941295
c.args.push_back("-G");

0 commit comments

Comments
 (0)