[Openmp-commits] [openmp] 3f9519b - [OpenMP] Only use #pragma comment(lib, ...) in MSVC build configurations
Martin Storsjö via Openmp-commits
openmp-commits at lists.llvm.org
Fri Feb 12 11:56:13 PST 2021
Author: Martin Storsjö
Date: 2021-02-12T21:55:31+02:00
New Revision: 3f9519b768ebe7a2731443bdc2d3178a005e8d7f
URL: https://github.com/llvm/llvm-project/commit/3f9519b768ebe7a2731443bdc2d3178a005e8d7f
DIFF: https://github.com/llvm/llvm-project/commit/3f9519b768ebe7a2731443bdc2d3178a005e8d7f.diff
LOG: [OpenMP] Only use #pragma comment(lib, ...) in MSVC build configurations
MinGW build configurations don't support this pragma (unless
compiling with clang, with -fms-extensions, and linking with
lld), and at least clang warns about it.
This library does end up linked by the cmake files anyway (as
long as the check works properly).
Differential Revision: https://reviews.llvm.org/D96581
Added:
Modified:
openmp/runtime/src/z_Windows_NT_util.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/z_Windows_NT_util.cpp b/openmp/runtime/src/z_Windows_NT_util.cpp
index 7a22df02eb2e..2e9484b2d175 100644
--- a/openmp/runtime/src/z_Windows_NT_util.cpp
+++ b/openmp/runtime/src/z_Windows_NT_util.cpp
@@ -24,7 +24,9 @@
#include <ntsecapi.h> // UNICODE_STRING
#include <ntstatus.h>
#include <psapi.h>
+#ifdef _MSC_VER
#pragma comment(lib, "psapi.lib")
+#endif
enum SYSTEM_INFORMATION_CLASS {
SystemProcessInformation = 5
More information about the Openmp-commits
mailing list