mirror of
https://github.com/verilator/verilator.git
synced 2025-01-03 21:27:35 +00:00
Fix mingw build (#2215)
* v3Os: include <windows.h> instead of <winnt.h> The windows.h header file should be included prior to any other headers, in order to ensure all definitions are available. By only including some headers, such as winnt.h, many "undefined symbol" messages are generated. Include "windows.h" to fix the build on msys2 under mingw64. Signed-off-by: Sean Cross <sean@xobs.io> * configure: check for bcrypt and psapi on windows These two libraries must be linked in order to have access to BCryptGenRandom and GetProcessMemoryInfo respectively. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
a1a2650f1e
commit
1fe5d5db79
@ -370,8 +370,13 @@ AC_SUBST(CFG_LDFLAGS_SRC)
|
||||
# The pthread library is required by tcmalloc, so add it if it exists. If it
|
||||
# does not, the tcmalloc check below will fail anyway, and linking against
|
||||
# pthreads is harmless otherwise.
|
||||
CFG_LIBS="$LIBS $CFG_LIBS"
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
|
||||
|
||||
# Check libraries for MingW
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
|
||||
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpsapi)
|
||||
|
||||
# Check if tcmalloc is available based on --enable-tcmalloc
|
||||
_MY_LDLIBS_CHECK_IFELSE(
|
||||
$LTCMALLOC,
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
# include <winnt.h> // LONG for bcrypt.h on MINGW
|
||||
# include <windows.h> // LONG for bcrypt.h on MINGW
|
||||
# include <bcrypt.h> // BCryptGenRandom
|
||||
# include <chrono>
|
||||
# include <direct.h> // mkdir
|
||||
|
Loading…
Reference in New Issue
Block a user