Skip to content

Commit b0fdee6

Browse files
committed
Some refinements after testing on VS2019 and VS2022
1 parent 32f75f7 commit b0fdee6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

premake4.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ solution ("lib" .. tgtname)
7373
location ('.')
7474

7575
project (tgtname)
76-
local outdir = "MSVC_$(" .. transformMN("Platform") .. ")_$(" .. transformMN("Configuration") .. ")." .. action
76+
local outdir = "MSVC\$(" .. transformMN("Platform") .. ")_$(" .. transformMN("Configuration") .. ")." .. action
7777
uuid ("47726E76-07B8-433D-A9AF-01111EB92825")
7878
language ("C")
7979
kind ("StaticLib")
8080
targetname (tgtname)
81-
flags {"Unicode", "NativeWChar",}
81+
flags {"Unicode", "NativeWChar", "FatalWarnings"}
8282
targetdir (outdir)
8383
objdir (outdir .. "\\Intermediate")
8484
libdirs {"$(IntDir)"}
8585
includedirs {"."} -- not really needed, but we try to stay true to makefile.msvc
86-
defines {"WINVER=0x0501", "WIN32", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE",}-- "__STDC_WANT_SECURE_LIB__=1", "_CRT_HAS_CXX17=0",}
87-
buildoptions {"/Z7", "/Wall", "/wd4146", "/wd4127", "/wd4668", "/wd4710", "/wd4711", "/wd4820", "/WX",} -- "/wd5045" does not work on VS2008!
88-
-- /Z7 for a static lib includes all debug symbols inside the object files, meaning there is no need to distribute PDB and .lib file
86+
defines {"WIN32_LEAN_AND_MEAN", "WINVER=0x0501", "WIN32", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE",}-- "__STDC_WANT_SECURE_LIB__=1", "_CRT_HAS_CXX17=0",}
87+
buildoptions {"/Z7", "/Wall", "/wd4146", "/wd4127", "/wd4668", "/wd4710", "/wd4711", "/wd4820",}
88+
-- /Z7 for a static lib includes all debug symbols inside the object files, meaning there is no need to distribute PDB _and_ .lib file
8989

9090
excludes
9191
{
@@ -131,3 +131,9 @@ solution ("lib" .. tgtname)
131131

132132
configuration("vs2003 or vs2005")
133133
buildoptions {"/wd4242", "/wd4244",}
134+
135+
configuration("vs2019 or vs2022")
136+
buildoptions {"/wd5045",}
137+
138+
configuration("vs2017 or vs2019 or vs2022")
139+
buildoptions {"/permissive-",}

s_mp_rand_platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ static mp_err s_read_arc4random(void *p, size_t n)
2626
#define WINVER 0x0501
2727
#endif
2828

29+
#ifndef WIN32_LEAN_AND_MEAN
2930
#define WIN32_LEAN_AND_MEAN
31+
#endif
3032
#include <windows.h>
3133
#include <wincrypt.h>
3234

0 commit comments

Comments
 (0)