Skip to content

Commit c9731e1

Browse files
authored
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.
1 parent 4147a8c commit c9731e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/couch/rebar.config.script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,17 @@ end.
222222
};
223223
{win32, _} when SMVsn == "102" ->
224224
{
225-
"/std:c++17 /DXP_WIN",
225+
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
226226
"$LDFLAGS mozjs-102.lib"
227227
};
228228
{win32, _} when SMVsn == "115" ->
229229
{
230-
"/std:c++17 /DXP_WIN",
230+
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
231231
"$LDFLAGS mozjs-115.lib"
232232
};
233233
{win32, _} when SMVsn == "128" ->
234234
{
235-
"/std:c++17 /DXP_WIN",
235+
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8",
236236
"$LDFLAGS mozjs-128.lib"
237237
}
238238
end.

0 commit comments

Comments
 (0)