Skip to content
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

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openmp/cmake/HandleOpenMPOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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 ..)


# 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()
Loading