Fix for bba to make it portable

This commit is contained in:
Miodrag Milanovic 2019-12-06 20:26:49 +01:00
parent b8636902e3
commit a28786097d
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ENDIF(CMAKE_CROSSCOMPILING)
IF(NOT CMAKE_CROSSCOMPILING) IF(NOT CMAKE_CROSSCOMPILING)
ADD_EXECUTABLE(bbasm bba/main.cc) ADD_EXECUTABLE(bbasm bba/main.cc)
target_link_libraries(bbasm LINK_PUBLIC ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(bbasm LINK_PUBLIC ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
ENDIF(NOT CMAKE_CROSSCOMPILING) ENDIF(NOT CMAKE_CROSSCOMPILING)
IF(NOT CMAKE_CROSSCOMPILING) IF(NOT CMAKE_CROSSCOMPILING)

View File

@ -19,6 +19,7 @@
*/ */
#include <assert.h> #include <assert.h>
#include <boost/filesystem/convenience.hpp>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
#include <iostream> #include <iostream>
#include <map> #include <map>
@ -446,8 +447,7 @@ int main(int argc, char **argv)
fprintf(fileOut, "%s\n", s.c_str()); fprintf(fileOut, "%s\n", s.c_str());
fprintf(fileOut, "const char %s[%d] =\n", streams[0].name.c_str(), int(data.size()) + 1); fprintf(fileOut, "const char %s[%d] =\n", streams[0].name.c_str(), int(data.size()) + 1);
char *bin_basename_buf = strdup(files.at(2).c_str()); fprintf(fileOut, "#embed_str \"%s\"\n",boost::filesystem::basename(files.at(2)).c_str());
fprintf(fileOut, "#embed_str \"%s\"\n", basename(bin_basename_buf));
fprintf(fileOut, ";\n"); fprintf(fileOut, ";\n");
for (auto &s : postText) for (auto &s : postText)