<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60607>60607</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] HAVE_CLANG_REPL_SUPPORT is being set to ON on Windows and the Visual C++ build fails
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cristianadam
</td>
</tr>
</table>
<pre>
On Windows with LLVM/Clang `16.0.0-rc2` tag I can't build clang due to the fact that the `HAVE_CLANG_REPL_SUPPORT` is being set to `ON` due to how the CMake code is being written.
Visual C++ will fail to link `clang-repl.exe` due to the big number of symbols.
The following code allows me to build by setting the `HAVE_CLANG_REPL_SUPPORT` to `OFF` when configuring LLVM/Clang.
```diff
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 090cfa352078..51e471bbbeb0 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -411,7 +411,7 @@ CMAKE_DEPENDENT_OPTION(CLANG_PLUGIN_SUPPORT
# If libstdc++ is statically linked, clang-repl needs to statically link libstdc++
# itself, which is not possible in many platforms because of current limitations in
# JIT stack. (more platforms need to be supported by JITLink)
-if(NOT LLVM_STATIC_LINK_CXX_STDLIB)
+if(NOT LLVM_STATIC_LINK_CXX_STDLIB AND NOT DEFINED HAVE_CLANG_REPL_SUPPORT)
set(HAVE_CLANG_REPL_SUPPORT ON)
endif()
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE2PozgQ_TXOpRRkHCBwyCGfs5lJk2ia6Z1bZLABbxs7wmbT_e9XNumvWfXOSlGC46pXr6oejxojGsX5AsUrFG8mdLCt7hdVL4wVVFFGu0mp2fPiqOBPoZi-GrgK28Lh8HCHyG4tqWoAJThMAhzgaV8RlGCwtIE9VFQhMrdQDkIyqHwoGzhYDbblUNPKgm2p9SeU4D-WD9vz-rDMv5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