aboutsummaryrefslogtreecommitdiff
path: root/openmp/cmake
diff options
context:
space:
mode:
authorAlexandre Ganea <alex_toresh@yahoo.fr>2024-01-23 12:03:12 -0500
committerAlexandre Ganea <alex_toresh@yahoo.fr>2024-01-23 12:48:38 -0500
commit15fdc7646ca24506ccb6a59861da8f3b52ab031c (patch)
treea0316edaf8b18847b795ab6bc1b300c6db59f79f /openmp/cmake
parent6a7abea47418721616c9dd7a16f5cc3e5a67d49c (diff)
downloadllvm-15fdc7646ca24506ccb6a59861da8f3b52ab031c.zip
llvm-15fdc7646ca24506ccb6a59861da8f3b52ab031c.tar.gz
llvm-15fdc7646ca24506ccb6a59861da8f3b52ab031c.tar.bz2
Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang ToT (#77853)
The reverts 94f960925b7f609636fc2ffd83053814d5e45ed1 and fixes it.
Diffstat (limited to 'openmp/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()