@@ -19,10 +19,12 @@ using namespace utility::types;
19
19
#define OBJECT_FILE " test.obj"
20
20
#define EXECUTABLE_FILE " test.exe"
21
21
#define SYSTEM_STR " windows"
22
+ #define EXECUTABLE_OPT " "
22
23
#else
23
24
#define OBJECT_FILE " test.o"
24
25
#define EXECUTABLE_FILE " test"
25
26
#define SYSTEM_STR " linux"
27
+ #define EXECUTABLE_OPT " ./"
26
28
#endif
27
29
28
30
@@ -64,7 +66,7 @@ auto get_pretty_path(const filepath& path) -> filepath {
64
66
65
67
auto compile_file (const filepath& path, const filepath& compiler_path) -> bool {
66
68
const std::string compilation_command = std::format (" {} compile {} -e {} --system {} > {} 2> {}" , compiler_path, path, OBJECT_FILE, SYSTEM_STR, COMPILER_STDOUT, COMPILER_STDERR);
67
- const std::string link_command = std::format (" clang -o {} {} " , EXECUTABLE_FILE, OBJECT_FILE );
69
+ const std::string link_command = std::format (" clang {} -o {} " , OBJECT_FILE, EXECUTABLE_FILE );
68
70
69
71
// compile the source file
70
72
if (utility::shell::execute (compilation_command) != 0 ) {
@@ -94,7 +96,7 @@ auto compile_file(const filepath& path, const filepath& compiler_path) -> bool {
94
96
}
95
97
96
98
auto run_executable (const filepath& path) -> i32 {
97
- const std::string command = std::format (" {} > {} 2> {}" , path, APP_STDOUT, APP_STDERR);
99
+ const std::string command = std::format (" {}{} > {} 2> {}" , EXECUTABLE_OPT , path, APP_STDOUT, APP_STDERR);
98
100
return utility::shell::execute (command);
99
101
}
100
102
0 commit comments