]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Support .bat and .cmd scripts as the compiler on Windows (#1546)
authorDoekin <105162544+Doekin@users.noreply.github.com>
Fri, 10 Jan 2025 13:27:56 +0000 (21:27 +0800)
committerGitHub <noreply@github.com>
Fri, 10 Jan 2025 13:27:56 +0000 (14:27 +0100)
src/ccache/execute.cpp
src/ccache/util/path.cpp
src/ccache/util/path.hpp

index ce529ac230ee1e3873ba26d71d7f08f0ada0ac11..d9d222e4fb2e63e279a294e2019c87880e383ebe 100644 (file)
@@ -244,7 +244,7 @@ win32execute(const char* path,
     tmp_file_path = tmp_file.path;
     LOG("Arguments from {}", tmp_file.path);
   }
-  BOOL ret = CreateProcess(full_path.c_str(),
+  BOOL ret = CreateProcess(nullptr,
                            const_cast<char*>(args.c_str()),
                            nullptr,
                            nullptr,
index f23db8a05c19b794675699fc92a990000532b279..6c3376c3e3ead7e55c6d646f80f224ac1d66c902 100644 (file)
@@ -37,7 +37,7 @@ std::string
 add_exe_suffix(const std::string& program)
 {
   std::string ext = util::to_lowercase(fs::path(program).extension().string());
-  if (ext == ".exe" || ext == ".bat" || ext == ".sh") {
+  if (ext == ".exe" || ext == ".bat" || ext == ".cmd" || ext == ".sh") {
     return program;
   } else {
     return program + ".exe";
index 3ede6224a9078f66b9d41ff439c6a24df35e188c..fe850ef4ff1e0041b429115b6b9bbfad2c184d13 100644 (file)
@@ -31,8 +31,8 @@ namespace util {
 
 // --- Interface ---
 
-// Add ".exe" suffix to `program` if it doesn't already end with ".exe", ".bat"
-// or ".sh".
+// Add ".exe" suffix to `program` if it doesn't already end with ".exe", ".bat",
+// ".cmd" or ".sh".
 std::string add_exe_suffix(const std::string& program);
 
 // Return a new path with `extension` added to `path` (keeping any existing