diff --git a/src/Makefile.am b/src/Makefile.am index 8db960473..9d893f68f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -334,6 +334,15 @@ if WINGUI LIBS += -lpsapi endif +if WINCONSOLE +LIBS += -lpsapi +endif + +## FIXME: Should be allwed, but fails within MSYS2 +#if SHWIN +#LIBS += -lpsapi +#endif + CLEANFILES = ngspice.idx spinit tclspinit pkgIndex.tcl MAINTAINERCLEANFILES = Makefile.in diff --git a/src/frontend/resource.c b/src/frontend/resource.c index bda68d1e7..1d1dd47a1 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -479,7 +479,8 @@ fprintmem(FILE *stream, unsigned long long memory) { static int get_procm(struct proc_mem *memall) { #if defined(_MSC_VER) || defined(__MINGW32__) -#if (_WIN32_WINNT >= 0x0500) && defined(HAS_WINGUI) + /* FIXME: shared module should be allowed, but currently does not link to psapi within MINGW/MSYS2 */ +#if (_WIN32_WINNT >= 0x0500) && (!defined(SHARED_MODULE) || _MSC_VER) /* Use Windows API function to obtain size of memory - more accurate */ HANDLE hProcess; PROCESS_MEMORY_COUNTERS pmc;