Skip to content

Commit dc5e1d0

Browse files
committed
[Bazel] Set the right default for LLVM_WINDOWS_PREFER_FORWARD_SLASH on Windows
This cmake configure option was added in df0ba47, and was ported to Bazel in 7d323dc. However, the setting chosen in Bazel seems accidental, not necessarily intentional. LLVM_WINDOWS_PREFER_FORWARD_SLASH has no effect on Unix, and on Windows, setting it to 0 is the default, which gets the same behaviour as before. Setting it to 1 enables new experimental behaviours (which is enabled by default on MinGW targets only). As I don't see any explicit intent to opt in to the new experimental behaviour, I believe the current configuration in bazel was a mistake. Differential Revision: https://reviews.llvm.org/D114065
1 parent ace03d0 commit dc5e1d0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

utils/bazel/llvm-project-overlay/llvm/config.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ posix_defines = [
3636
"HAVE_STRERROR_R=1",
3737
"HAVE_SYSEXITS_H=1",
3838
"HAVE_UNISTD_H=1",
39-
"LLVM_WINDOWS_PREFER_FORWARD_SLASH=0",
4039
]
4140

4241
linux_defines = posix_defines + [
@@ -71,7 +70,6 @@ win32_defines = [
7170
# LLVM features
7271
r'LTDL_SHLIB_EXT=\".dll\"',
7372
r'LLVM_PLUGIN_EXT=\".dll\"',
74-
"LLVM_WINDOWS_PREFER_FORWARD_SLASH=1",
7573
]
7674

7775
# TODO: We should switch to platforms-based config settings to make this easier

utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */
3636
#define LLVM_ENABLE_CRASH_DUMPS 0
3737

38+
/* Define to 1 to prefer forward slashes on Windows, and to 0 prefer
39+
backslashes. */
40+
#define LLVM_WINDOWS_PREFER_FORWARD_SLASH 0
41+
3842
/* Define to 1 if you have the `backtrace' function. */
3943
/* HAVE_BACKTRACE defined in Bazel */
4044

0 commit comments

Comments
 (0)