IntelLLVM: IPO fails on Windows
The CMake sample below fails on Windows with MSVC 2019 (16.11.7) + IntelLLVM 2022.1 (2022.1.0.20220316):
cmake_minimum_required(
VERSION 3.24.0)
set(CMAKE_C_COMPILER "icx")
set(CMAKE_CXX_COMPILER "icx")
enable_language(C CXX)
project(CMake-IntelLLVM-WIN32)
include(CheckIPOSupported)
check_ipo_supported()
Ran like:
cmake -G Ninja -B build\ .
Gives:
-- The C compiler identification is IntelLLVM 2022.1.0 with MSVC-like command-line
-- The CXX compiler identification is IntelLLVM 2022.1.0 with MSVC-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at D:/.../cmake-3.24/Modules/CheckIPOSupported.cmake:68 (message):
IPO is not supported (CMake doesn't support IPO for current CXX compiler).
Call Stack (most recent call first):
D:/.../cmake-3.24/Modules/CheckIPOSupported.cmake:245 (_ipo_not_supported)
CMakeLists.txt:12 (check_ipo_supported)
-- Configuring incomplete, errors occurred!
See also "D:/.../build/CMakeFiles/CMakeOutput.log".