summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam R. Dieter <william.r.dieter@intel.com>2021-03-10 19:38:11 -0500
committerBrad King <brad.king@kitware.com>2021-03-15 14:43:23 -0400
commit6fd014a4b6708415b5ca26809b661320c4797835 (patch)
treeff70089b02bb45013724d1d8e560f8bd06c53e0f
parentdfdea7d9e3900dfc778b4c5243c0aa13379cb56d (diff)
downloadcmake-6fd014a4b6708415b5ca26809b661320c4797835.tar.gz
FindOpenMP: Use -Qiopenmp instead of -fiopenmp for IntelLLVM on Windows
The Windows driver does not like the `-f` form of this option. Note that we prefer `-Qiopenmp/-fiopenmp` over `-Qopenmp/-fopenmp` in order to generate LLVM IR with parallelization information, which the backend uses to generate parallelized code. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
-rw-r--r--Modules/FindOpenMP.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index a1ffc25184..52330a4970 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -113,7 +113,12 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
else()
set(OMP_FLAG_Intel "-qopenmp")
endif()
- set(OMP_FLAG_IntelLLVM "-fiopenmp")
+ if(CMAKE_${LANG}_COMPILER_ID STREQUAL "IntelLLVM" AND
+ "x${CMAKE_${LANG}_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ set(OMP_FLAG_IntelLLVM "-Qiopenmp")
+ else()
+ set(OMP_FLAG_IntelLLVM "-fiopenmp")
+ endif()
set(OMP_FLAG_MSVC "-openmp")
set(OMP_FLAG_PathScale "-openmp")
set(OMP_FLAG_NAG "-openmp")