Use /MD on windows.

Just makes things easier. Assume machines have msvcrt.dll
on them. If not, we can add msvcrt.dll to the dist folder and add to
installer.
This commit is contained in:
Calvin Rose 2019-11-09 16:05:07 -05:00
parent 135abff100
commit c9292ef648
3 changed files with 3 additions and 22 deletions

View File

@ -116,14 +116,14 @@
(def default-lflags (if is-win ["/nologo"] []))
(def default-cflags
(if is-win
["/nologo"]
["/nologo" "/MD"]
["-std=c99" "-Wall" "-Wextra"]))
# Required flags for dynamic libraries. These
# are used no matter what for dynamic libraries.
(def- dynamic-cflags
(if is-win
[]
["/LD"]
["-fPIC"]))
(def- dynamic-lflags
(if is-win

View File

@ -19,7 +19,7 @@
@rem Set compile and link options here
@setlocal
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS
@set JANET_COMPILE=cl /nologo /Isrc\include /Isrc\conf /c /O2 /W3 /D_CRT_SECURE_NO_WARNINGS /MD
@set JANET_LINK=link /nologo
@set JANET_LINK_STATIC=lib /nologo

View File

@ -46,25 +46,6 @@ int main(int argc, char **argv) {
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(hOut, dwMode);
SetConsoleOutputCP(65001);
/* Add directory containing janet.exe as DLL search path for
dynamic modules on windows. This is needed because dynamic modules reference
janet.exe for symbols. Otherwise, janet.exe would have to be in the current directory
to load natives correctly. */
#ifndef JANET_NO_DYNAMIC_MODULES
{
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_USER_DIRS);
HMODULE hModule = GetModuleHandleW(NULL);
wchar_t path[MAX_PATH];
GetModuleFileNameW(hModule, path, MAX_PATH);
size_t i = wcsnlen(path, MAX_PATH);
while (i > 0 && path[i] != '\\')
path[i--] = '\0';
if (i) AddDllDirectory(path);
GetCurrentDirectoryW(MAX_PATH, path);
AddDllDirectory(path);
}
#endif
#endif
/* Set up VM */