aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2019-11-09 16:05:07 -0500
committerCalvin Rose <calsrose@gmail.com>2019-11-09 16:05:07 -0500
commitc9292ef648d6e67bee4654c756d6d1f049ad79af (patch)
tree24a07784dad854870e6c45ac17340686350a86ef
parentTry again with vcvarsall.bat (diff)
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.
-rwxr-xr-xauxbin/jpm4
-rw-r--r--build_win.bat2
-rw-r--r--src/mainclient/main.c19
3 files changed, 3 insertions, 22 deletions
diff --git a/auxbin/jpm b/auxbin/jpm
index 22483195..2abab3e3 100755
--- a/auxbin/jpm
+++ b/auxbin/jpm
@@ -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
diff --git a/build_win.bat b/build_win.bat
index e618dd1b..e1013c01 100644
--- a/build_win.bat
+++ b/build_win.bat
@@ -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
diff --git a/src/mainclient/main.c b/src/mainclient/main.c
index 21809873..dcc9f6b6 100644
--- a/src/mainclient/main.c
+++ b/src/mainclient/main.c
@@ -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 */