Skip to content

Commit

Permalink
Merge pull request #316 from naussika/main
Browse files Browse the repository at this point in the history
HexGenerator: Fixes .hex file location for building on macOS/Linux
  • Loading branch information
Mysticial authored Mar 10, 2023
2 parents c2421af + 7d43a4b commit e6475a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 1 addition & 14 deletions HexGenerator/Source/Tools/CommandRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,7 @@ int build_hexfile(
});
return 1;
};
char buffer[262144];
std::string data;
std::string result;
int dist=0;
int size;

//TIME_START
while(!feof(pipe)) {
size=(int)fread(buffer,1,262144, pipe); //cout<<buffer<<" size="<<size<<endl;
data.resize(data.size()+size);
memcpy(&data[dist],buffer,size);
dist+=size;
}
//TIME_PRINT_

int ret = pclose(pipe)/256;
if (ret != 0) {
std::string msg = "Build process exited with code: " + std::to_string(ret);
Expand Down
5 changes: 3 additions & 2 deletions NativePrograms/Scripts/BuildOneUnix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rm $program.sym > /dev/null 2>&1
rm $program.elf > /dev/null 2>&1

# Also putting this behind the gui-wall
if [[ $gui == "gui" ]]; then
mv "$program.hex" "../$program-$board.hex"
if [[ $gui == "gui" ]]; then
CATEGORY="$(basename ${PWD})" # hex_file = settings.path + m_category + "-" + m_name + ("-" + board + ".hex").c_str();
mv "$program.hex" "../../${CATEGORY}-$program-$board.hex"
fi

0 comments on commit e6475a2

Please sign in to comment.