You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2024/12/18 19:29:44 UTC

(couchdb) branch main updated: fix(dev): Add compiler flags for MSVC (#5366)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new c9731e161 fix(dev): Add compiler flags for MSVC (#5366)
c9731e161 is described below

commit c9731e16181cedda69c91df8ddde9b18ba8b6952
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Wed Dec 18 20:29:38 2024 +0100

    fix(dev): Add compiler flags for MSVC (#5366)
    
    To get `couchjs` compiled on Windows with newer
    SpiderMonkeys (102, 115 and 128), we need to tell
    the MS compiler (cl.exe) to compile macros with
    `__VA_ARGS__` correctly. To get this, we need to
    add an extra compile flag `/Zc:preprocessor`.
    
    Add `/utf-8` to correctly parse source files.
---
 src/couch/rebar.config.script | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index 024bba8e7..e26b6b608 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -222,17 +222,17 @@ end.
         };
     {win32, _} when SMVsn == "102" ->
         {
-            "/std:c++17 /DXP_WIN",
+            "/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
             "$LDFLAGS mozjs-102.lib"
          };
     {win32, _} when SMVsn == "115" ->
         {
-            "/std:c++17 /DXP_WIN",
+            "/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
             "$LDFLAGS mozjs-115.lib"
         };
     {win32, _} when SMVsn == "128" ->
         {
-            "/std:c++17 /DXP_WIN",
+            "/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
             "$LDFLAGS mozjs-128.lib"
         }
 end.