summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-18 12:23:28 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-18 12:23:28 -0500
commite239b66691200163c1983b645c28b34825f32ea4 (patch)
treebad2b6a2f685462504898855880f8e84fbd69a28 /build.c
parent14811a586d77ab9a1fa8bef360250992aead55d1 (diff)
:build working on windows
Diffstat (limited to 'build.c')
-rw-r--r--build.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/build.c b/build.c
index e0cf2be..60cd70f 100644
--- a/build.c
+++ b/build.c
@@ -45,17 +45,22 @@ static void build_start(Ted *ted) {
if (cargo) {
program = "cargo";
argv[0] = "build";
+ } else if (fs_file_exists("make.bat")) {
+ program = "make.bat";
} else {
program = "make";
}
#endif
- process_exec(&ted->build_process, program, argv);
- ted->building = true;
- ted->build_shown = true;
- buffer_new_file(&ted->build_buffer, NULL);
- ted->build_buffer.store_undo_events = false; // don't need undo events for build output buffer
- ted->build_buffer.view_only = true;
+ if (process_exec(&ted->build_process, program, argv)) {
+ ted->building = true;
+ ted->build_shown = true;
+ buffer_new_file(&ted->build_buffer, NULL);
+ ted->build_buffer.store_undo_events = false; // don't need undo events for build output buffer
+ ted->build_buffer.view_only = true;
+ } else {
+ ted_seterr("Couldn't start build: %s", process_geterr(&ted->build_process));
+ }
}
static void build_stop(Ted *ted) {