Skip to content

Commit

Permalink
Some refinements after testing on VS2019 and VS2022
Browse files Browse the repository at this point in the history
  • Loading branch information
assarbad committed Feb 13, 2022
1 parent 32f75f7 commit b7c70cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions premake4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ solution ("lib" .. tgtname)
location ('.')

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

excludes
Expand Down Expand Up @@ -131,3 +131,9 @@ solution ("lib" .. tgtname)

configuration("vs2003 or vs2005")
buildoptions {"/wd4242", "/wd4244",}

configuration("vs2019 or vs2022")
buildoptions {"/wd5045",}

configuration("vs2017 or vs2019 or vs2022")
buildoptions {"/permissive-",}
2 changes: 2 additions & 0 deletions s_mp_rand_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ static mp_err s_read_arc4random(void *p, size_t n)
#define WINVER 0x0501
#endif

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <wincrypt.h>

Expand Down

0 comments on commit b7c70cd

Please sign in to comment.