-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[openmp] On Windows, fix standalone cmake build #80174
Conversation
@llvm/pr-subscribers-openmp Author: Alexandre Ganea (aganea) ChangesThis fixes: #80117 Full diff: https://github.com/llvm/llvm-project/pull/80174.diff 1 Files Affected:
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()
|
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using append_if(TRUE ...)
because on MSVC silencing unknown warnings is a silent action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just use list(APPEND ...)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string(APPEND ...)
perhaps but it needs two lines so it's just shorter to write append_if(TRUE ..)
|
As suggested. |
@@ -9,6 +9,14 @@ if (NOT COMMAND append_if) | |||
endfunction() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then here we can just call append
Tested with the status of this PR (4654c3d), and can confirm that windows build succeeds now. Thanks a lot! |
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: llvm#80117 (cherry picked from commit d2565bb)
This fixes: #80117