forked from solstice/solstice
Output ground files as executable
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <groundvm.h>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
@@ -56,8 +57,9 @@ int main(int argc, char** argv) {
|
||||
if (!outputFile) {
|
||||
std::cout << "Failed to write to " << args.output.value().value << "\n";
|
||||
}
|
||||
outputFile << result;
|
||||
outputFile << "#!/usr/bin/env ground\n" << result;
|
||||
outputFile.close();
|
||||
system(std::string("chmod +x " + args.output.value().value).c_str());
|
||||
exit(0);
|
||||
} else if (args.outputtype.value().value == "native") {
|
||||
std::string assembly(groundCompileProgram(&program));
|
||||
|
||||
Reference in New Issue
Block a user