Skip to content

Commit 40b6a6a

Browse files
committed
Port build_and_run_test() to msvc
1 parent a92d252 commit 40b6a6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nob.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ bool build_and_run_test(Cmd *cmd, const char *test_name)
1919
{
2020
const char *bin_path = temp_sprintf("%s%s", BUILD_FOLDER TESTS_FOLDER, test_name);
2121
const char *src_path = temp_sprintf("%s%s.c", TESTS_FOLDER, test_name);
22+
#ifdef _MSC_VER
23+
cmd_append(cmd, "cl", "-I.", "-o", bin_path, src_path);
24+
#else
2225
cmd_append(cmd, "cc", "-Wall", "-Wextra", "-Wswitch-enum", "-I.", "-o", bin_path, src_path);
26+
#endif // _MSC_VER
2327
if (!cmd_run_sync_and_reset(cmd)) return false;
2428
cmd_append(cmd, bin_path);
2529
if (!cmd_run_sync_and_reset(cmd)) return false;

0 commit comments

Comments
 (0)