[Openmp-commits] [openmp] [openmp] On Windows, fix standalone cmake build (PR #80174)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 31 10:28:52 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-openmp

Author: Alexandre Ganea (aganea)

<details>
<summary>Changes</summary>

This fixes: https://github.com/llvm/llvm-project/issues/80117

---
Full diff: https://github.com/llvm/llvm-project/pull/80174.diff


1 Files Affected:

- (modified) openmp/cmake/HandleOpenMPOptions.cmake (+2-2) 


``````````diff
diff --git a/openmp/cmake/HandleOpenMPOptions.cmake b/openmp/cmake/HandleOpenMPOptions.cmake
index 201aeabbd3df9..79dfa334d749e 100644
--- a/openmp/cmake/HandleOpenMPOptions.cmake
+++ b/openmp/cmake/HandleOpenMPOptions.cmake
@@ -44,9 +44,9 @@ append_if(OPENMP_HAVE_DATA_SECTIONS "-fdata-sections" CMAKE_C_FLAGS CMAKE_CXX_FL
 
 if (MSVC)
   # Disable "warning C4201: nonstandard extension used: nameless struct/union"
-  append("-wd4201" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  append_if(TRUE "-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)
+  append_if(TRUE "-wd4190" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()

``````````

</details>


https://github.com/llvm/llvm-project/pull/80174


More information about the Openmp-commits mailing list