Skip to content

Commit

Permalink
Fix tree-panda-gcc temporary file output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansaya committed Jun 29, 2024
1 parent b3629c3 commit 9d7f282
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tree-panda-gcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,16 @@ int main(int argc, char* argv_orig[])
std::string raw_file_name;
if(Param->isOption(OPT_compress_archive))
{
auto archive_file = Param->getOption<std::string>(OPT_compress_archive);
std::string fname = archive_file.substr(0, archive_file.find('.'));
fname = fname + ".o";
const auto archive_file = Param->getOption<std::filesystem::path>(OPT_compress_archive);
auto temp_obj = Param->getOption<std::filesystem::path>(OPT_output_temporary_directory) /
archive_file.filename().replace_extension(".o");
{
fileIO_ostreamRef raw_file = fileIO_ostream_open(fname);
fileIO_ostreamRef raw_file = fileIO_ostream_open(temp_obj.string());
PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Dumping Tree-Manager");
(*raw_file) << TM;
TM->print(*raw_file);
PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Dumped Tree-Manager");
}
std::string command = "ar cru " + archive_file + " " + fname;
std::string command = "ar cru " + archive_file.string() + " " + temp_obj.string();
// std::cout << command << std::endl;
int ret = PandaSystem(Param, command);
if(IsError(ret))
Expand All @@ -317,7 +317,7 @@ int main(int argc, char* argv_orig[])
}
fileIO_ostreamRef raw_file = fileIO_ostream_open(raw_file_name);
PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Dumping Tree-Manager");
(*raw_file) << TM;
TM->print(*raw_file);
PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Dumped Tree-Manager");
}
}
Expand Down

0 comments on commit 9d7f282

Please sign in to comment.