summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-17 18:12:33 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-17 18:12:33 -0500
commit14811a586d77ab9a1fa8bef360250992aead55d1 (patch)
tree2fab3e9d4140cfee65faea369d84a5f9e9566cda /build.c
parente719b02111d63aee561684d50e5fceaf1d099826 (diff)
started process-win.c
Diffstat (limited to 'build.c')
-rw-r--r--build.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/build.c b/build.c
index e9d9ddc..e0cf2be 100644
--- a/build.c
+++ b/build.c
@@ -14,17 +14,17 @@ static void build_start(Ted *ted) {
bool cargo = false;
- chdir(ted->cwd);
+ change_directory(ted->cwd);
strcpy(ted->build_dir, ted->cwd);
if (fs_file_exists("Cargo.toml")) {
cargo = true;
} else if (fs_file_exists(".." PATH_SEPARATOR_STR "Cargo.toml")) {
- chdir("..");
+ change_directory("..");
ted_full_path(ted, "..", ted->build_dir, sizeof ted->build_dir);
cargo = true;
} else if (fs_file_exists(".." PATH_SEPARATOR_STR ".." PATH_SEPARATOR_STR "Cargo.toml")) {
- chdir(".." PATH_SEPARATOR_STR "..");
+ change_directory(".." PATH_SEPARATOR_STR "..");
ted_full_path(ted, "../..", ted->build_dir, sizeof ted->build_dir);
cargo = true;
}
@@ -40,7 +40,14 @@ static void build_start(Ted *ted) {
argv[2] = "make";
}
#else
- #error "TODO"
+ char *program = NULL;
+ char *argv[2] = {NULL, NULL};
+ if (cargo) {
+ program = "cargo";
+ argv[0] = "build";
+ } else {
+ program = "make";
+ }
#endif
process_exec(&ted->build_process, program, argv);