diff options
author | William R. Dieter <william.r.dieter@intel.com> | 2021-03-11 00:38:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-15 18:43:23 (GMT) |
commit | 6fd014a4b6708415b5ca26809b661320c4797835 (patch) | |
tree | ff70089b02bb45013724d1d8e560f8bd06c53e0f /Modules/FindOpenMP.cmake | |
parent | dfdea7d9e3900dfc778b4c5243c0aa13379cb56d (diff) | |
download | CMake-6fd014a4b6708415b5ca26809b661320c4797835.zip CMake-6fd014a4b6708415b5ca26809b661320c4797835.tar.gz CMake-6fd014a4b6708415b5ca26809b661320c4797835.tar.bz2 |
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>
Diffstat (limited to 'Modules/FindOpenMP.cmake')
-rw-r--r-- | Modules/FindOpenMP.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index a1ffc25..52330a4 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") |