From ad76b56e099922068cd23d18d2a602fa3cdff393 Mon Sep 17 00:00:00 2001 From: Ciremun Date: Mon, 19 Jul 2021 00:39:00 +0300 Subject: [PATCH] #29 --- nobuild.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nobuild.h b/nobuild.h index d6ca471..f7507ad 100644 --- a/nobuild.h +++ b/nobuild.h @@ -203,7 +203,13 @@ void chain_echo(Chain chain); // TODO(#29): REBUILD_URSELF does not distinguish MSVC and MinGW setups on Windows #ifndef REBUILD_URSELF # if _WIN32 -# define REBUILD_URSELF(binary_path, source_path) CMD("cl.exe", source_path) +# if defined(__GNUC__) +# define REBUILD_URSELF(binary_path, source_path) CMD("gcc", "-o", binary_path, source_path) +# elif defined(__clang__) +# define REBUILD_URSELF(binary_path, source_path) CMD("clang", "-o", binary_path, source_path) +# elif defined(_MSC_VER) +# define REBUILD_URSELF(binary_path, source_path) CMD("cl.exe", source_path) +# endif # else # define REBUILD_URSELF(binary_path, source_path) CMD("cc", "-o", binary_path, source_path) # endif