VS: Support for Intel oneAPI DPC++ Compiler
I have a simple CMake project which I have tried to build with Visual Studio 2019 and certain toolset (-T option).
cmake_minimum_required(VERSION 3.14)
project(sycl-version LANGUAGES CXX)
add_executable(sycl_version dpcpp_version_info.cpp)
target_compile_options(sycl_version PRIVATE -fsycl)
target_link_options(sycl_version PRIVATE -fsycl)
With with toolset "v142" all works fine.
<PROJECT_ROOT>\build-v142>cmake -T"v142" ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.28.29334.0
-- The CXX compiler identification is MSVC 19.28.29334.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.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)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: <PROJECT_ROOT>/build-v141
But with another toolset cmake have failed with error, that CMAKE_CXX_COMPILER could be found
after reporting version of the C++ compiler.
<PROJECT_ROOT>\build-oneapi$cmake -T"Intel(R) oneAPI DPC++ Compiler" ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The CXX compiler identification is IntelDPCPP 12.0.0.1
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
But in Visual Studio projects itself (projects not from cmake generation) all works fine and toolchain oneAPI totally workable.
I am interesting and solving this problem (i will sending merge request in cmake, if I can solve it), so am intersted, where root of the problem, from where I can start to investigate? Is CMake need some integration in source code for Visual Studio for each toolchain? Or has CMake some expectations for Visual Studio toolchain file, which v142 toolchain is satisfied and oneAPI toolchain isn't?