summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/extccomp.nim10
-rw-r--r--compiler/options.nim2
-rw-r--r--config/nim.cfg5
3 files changed, 15 insertions, 2 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index 69705db43..ef371d5d0 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -153,6 +153,13 @@ compiler vcc:
     structStmtFmt: "$3$n$1 $2",
     props: {hasCpp, hasAssume, hasDeclspec})
 
+compiler clangcl:
+  result = vcc()
+  result.name = "clang_cl"
+  result.compilerExe = "clang-cl"
+  result.cppCompiler = "clang-cl"
+  result.linkerExe = "clang-cl"
+
 # Intel C/C++ Compiler
 compiler icl:
   result = vcc()
@@ -353,7 +360,8 @@ const
     pcc(),
     ucc(),
     icl(),
-    icc()]
+    icc(),
+    clangcl()]
 
   hExt* = ".h"
 
diff --git a/compiler/options.nim b/compiler/options.nim
index 7569598d0..49d2f7404 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -132,7 +132,7 @@ type
 
   TSystemCC* = enum
     ccNone, ccGcc, ccNintendoSwitch, ccLLVM_Gcc, ccCLang, ccLcc, ccBcc, ccDmc, ccWcc, ccVcc,
-    ccTcc, ccPcc, ccUcc, ccIcl, ccIcc
+    ccTcc, ccPcc, ccUcc, ccIcl, ccIcc, ccClangCl
 
   CfileFlag* {.pure.} = enum
     Cached,    ## no need to recompile this time
diff --git a/config/nim.cfg b/config/nim.cfg
index e6175784e..b52c71c94 100644
--- a/config/nim.cfg
+++ b/config/nim.cfg
@@ -226,6 +226,11 @@ clang.options.speed = "-O3"
 clang.options.size = "-Os"
 
 @if windows:
+  clang_cl.cpp.options.always %=  "${clang_cl.options.always} /EHsc"
+  @if not release:
+    clang_cl.options.linker = "/Z7"
+    clang_cl.cpp.options.linker = "/Z7"
+  @end
   clang.options.debug = "-g -gcodeview"
   clang.cpp.options.debug = "-g -gcodeview"
   @if not release: