wrappers: Provide the unprefixed clang-scan-deps as a wrapper, on Windows

When setting up wrappers for Windows, rename clang-scan-deps.exe to
clang-scan-deps-real.exe, make clang-scan-deps.exe a wrapper, and
configure the wrapper to target executing clang-scan-deps-real.exe.

This makes sure that we always pass in crucial options like
-stdlib=libc++.

By default, our Clang executables are built with that option
hardcoded, configured with CLANG_DEFAULT_CXX_STDLIB=libc++
when built for Windows. However, we generally don't rely on this;
we assume the tools could be plain default executables, so we
try to provide wrappers on all common access paths.
This commit is contained in:
Martin Storsjö committed 2024-05-02 20:03:56 +03:00
1 parent 06bd759e50
commit 74e45715e3
2 files changed
+9 -2

No files matched your search

+4 -1
View File
@@ -18,6 +18,9 @@
#include "native-wrapper.h"
#ifndef CLANG_SCAN_DEPS
#define CLANG_SCAN_DEPS "clang-scan-deps"
#endif
#ifndef DEFAULT_TARGET
#define DEFAULT_TARGET "x86_64-w64-mingw32"
#endif
@@ -29,7 +32,7 @@ int _tmain(int argc, TCHAR *argv[]) {
int max_arg = argc + 3;
const TCHAR **exec_argv = malloc((max_arg + 1) * sizeof(*exec_argv));
int arg = 0;
exec_argv[arg++] = concat(dir, _T("clang-scan-deps"));
exec_argv[arg++] = concat(dir, _T(CLANG_SCAN_DEPS));
// If changing this wrapper, change clang-scan-deps-wrapper.sh accordingly.
int i = 1;