aboutsummaryrefslogtreecommitdiff
path: root/openmp/cmake
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-02-08 15:28:46 +0200
committerGitHub <noreply@github.com>2024-02-08 15:28:46 +0200
commit72f04fa0734f8559ad515f507a4a3ce3f461f196 (patch)
tree882e81e93138b232162b8026212655fc08a5b76d /openmp/cmake
parentec1fcb381d884ca53e2e0dd4075f946c8f002de2 (diff)
downloadllvm-72f04fa0734f8559ad515f507a4a3ce3f461f196.zip
llvm-72f04fa0734f8559ad515f507a4a3ce3f461f196.tar.gz
llvm-72f04fa0734f8559ad515f507a4a3ce3f461f196.tar.bz2
[OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (#81113)
This was added in 4b7beab4187ab0766c3d7b272511d5751431a8da. When the flag was added implicitly elsewhere, it was added via llvm/cmake/modules/HandleLLVMOptions.cmake, where it wasn't added on Windows/Cygwin targets. This avoids one warning per object file in OpenMP.
Diffstat (limited to 'openmp/cmake')
-rw-r--r--openmp/cmake/HandleOpenMPOptions.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/openmp/cmake/HandleOpenMPOptions.cmake b/openmp/cmake/HandleOpenMPOptions.cmake
index 7134620..9387d9b 100644
--- a/openmp/cmake/HandleOpenMPOptions.cmake
+++ b/openmp/cmake/HandleOpenMPOptions.cmake
@@ -46,7 +46,11 @@ append_if(OPENMP_HAVE_WEXTRA_FLAG "-Wno-extra" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_WPEDANTIC_FLAG "-Wno-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_WMAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-append_if(OPENMP_HAVE_NO_SEMANTIC_INTERPOSITION "-fno-semantic-interposition" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+if (NOT (WIN32 OR CYGWIN))
+ # This flag is not relevant on Windows; the flag is accepted, but produces warnings
+ # about argument unused during compilation.
+ append_if(OPENMP_HAVE_NO_SEMANTIC_INTERPOSITION "-fno-semantic-interposition" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+endif()
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)