aboutsummaryrefslogtreecommitdiff
path: root/openmp/cmake/HandleOpenMPOptions.cmake
diff options
context:
space:
mode:
authorAlexandre Ganea <37383324+aganea@users.noreply.github.com>2024-01-23 08:38:18 -0500
committerGitHub <noreply@github.com>2024-01-23 08:38:18 -0500
commit10f3296dd7d74c975f208a8569221dc8f96d1db1 (patch)
tree0da54ead874c0a5438ad684b6a8ae25b78dd3297 /openmp/cmake/HandleOpenMPOptions.cmake
parent55f12299d890078708eb6d2e069dc117ad244d4d (diff)
downloadllvm-10f3296dd7d74c975f208a8569221dc8f96d1db1.zip
llvm-10f3296dd7d74c975f208a8569221dc8f96d1db1.tar.gz
llvm-10f3296dd7d74c975f208a8569221dc8f96d1db1.tar.bz2
[openmp] Fix warnings when building on Windows with latest MSVC or Clang ToT (#77853)
There were quite a few compilation warnings when building openmp on Windows with the latest Visual Studios 2022 version 17.8.4. Some other warnings were visible with the latest Clang at tip. This commit fixes all of them.
Diffstat (limited to 'openmp/cmake/HandleOpenMPOptions.cmake')
-rw-r--r--openmp/cmake/HandleOpenMPOptions.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/openmp/cmake/HandleOpenMPOptions.cmake b/openmp/cmake/HandleOpenMPOptions.cmake
index b0fd0b7..201aeab 100644
--- a/openmp/cmake/HandleOpenMPOptions.cmake
+++ b/openmp/cmake/HandleOpenMPOptions.cmake
@@ -41,3 +41,12 @@ append_if(OPENMP_HAVE_WMAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE
append_if(OPENMP_HAVE_NO_SEMANTIC_INTERPOSITION "-fno-semantic-interposition" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_FUNCTION_SECTIONS "-ffunction-section" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_DATA_SECTIONS "-fdata-sections" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
+if (MSVC)
+ # Disable "warning C4201: nonstandard extension used: nameless struct/union"
+ append("-wd4201" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
+ # Disable "warning C4190: '__kmpc_atomic_cmplx8_rd' has C-linkage specified, but returns
+ # UDT '__kmp_cmplx64_t' which is incompatible with C"
+ append("-wd4190" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+endif()