Skip to content

Commit

Permalink
create directories if profile name contains slash (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan authored Dec 13, 2022
1 parent e8b14c3 commit 9d82c95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/maiken/compiler/gcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ maiken::CompilerProcessCapture maiken::cpp::GccCompiler::buildExecutable(LinkDAO
}
std::string exe = out;
if (KTOSTRING(__MKN_KUL_OS__) == std::string("win")) exe += ".exe";

mkn::kul::File(exe).dir().mk();

p.arg("-o").arg(exe);
for (std::string const& d : dirs) p << mkn::kul::File(oStar(), d).escm();
for (std::string const& o : objects) p << mkn::kul::File(o).escm();
Expand Down Expand Up @@ -171,8 +174,13 @@ maiken::CompilerProcessCapture maiken::cpp::GccCompiler::buildLibrary(LinkDAO& d

std::string lib = out.dir().join(sharedLib(app, out.name()));


if (mode == compiler::Mode::STAT) lib = out.dir().join(staticLib(out.name()));
lib = mkn::kul::File(lib).esc();

mkn::kul::File out_file(lib);
out_file.dir().mk();

lib = out_file.esc();
std::string cmd = linker;
if (mode == compiler::Mode::SHAR) cmd = LD(linker);
std::vector<std::string> bits;
Expand Down
5 changes: 4 additions & 1 deletion src/maiken/compiler/win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ maiken::CompilerProcessCapture maiken::cpp::WINCompiler::buildExecutable(LinkDAO

std::string exe = out + ".exe";

mkn::kul::File out_file(exe);
out_file.dir().mk();

std::string cmd = LD(linker);
std::vector<std::string> bits;
if (cmd == linker && linker.find(" ") != std::string::npos) {
Expand All @@ -103,7 +106,7 @@ maiken::CompilerProcessCapture maiken::cpp::WINCompiler::buildExecutable(LinkDAO
}
mkn::kul::Process p(cmd);
for (unsigned int i = 1; i < bits.size(); i++) p.arg(bits[i]);
p.arg("-OUT:\"" + exe + "\"").arg("-nologo");
p.arg("-OUT:\"" + out_file.escm() + "\"").arg("-nologo");
for (std::string const& path : libPaths) p.arg("-LIBPATH:\"" + path + "\"");
for (std::string const& d : dirs) p.arg(mkn::kul::File(oStar(), d).escm());
for (std::string const& o : objects) p << mkn::kul::File(o).escm();
Expand Down

0 comments on commit 9d82c95

Please sign in to comment.