CMake has the notion of a Host toolchain which is useful for configuring for cross compilation and specifying which compiler to use. Would it be useful to extend this concept to cover Device toolchains as well? The OpenCL CTS Framework repository previously had the notion of a Device Toolchain described here: https://github.com/KhronosGroup/OpenCL-CTS-Framework/tree/master/03-conformance-checks
Some of the variables that were used in that repository are documented below:
CMAKE_OPENCL_TOOLCHAIN_NAME - A string that can be used to describe the compiler
CMAKE_OPENCL_C_COMPILER - Analogous to CMake's CMAKE_C_COMPILER variable. This is the path to the OpenCL C compiler binary
CMAKE_OPENCL_CXX_COMPILER - Analogous to CMake's CMAKE_CXX_COMPILER variable. This is the path to the OpenCL C++ compiler binary
CMAKE_OPENCL_CXX_STDLIB - This is the path to the OpenCL C++ compiler's standard library. OpenCL C++ standard libraries are assumed to be header-only for now.
CMAKE_OPENCL_CXX_INCLUDE_FLAG - Used when passing in additional includes to the OpenCL C or OpenCL C++ compiler. A typical definition is "-I".
CMAKE_OPENCL_CXX_OUTPUT_FLAG - Used when informing the compiler where to place the output binary. A typical definition is "-o".
CMAKE_OPENCL_CXX_INPUT_FLAG - Used when passing in the source file's path to the OpenCL or OpenCL C++ compiler. With the reference Clang, this is left unset.
CMAKE_OPENCL_DEFAULT_FLAGS - Default flags that are passed with every invocation of the compiler.
CMake has the notion of a Host toolchain which is useful for configuring for cross compilation and specifying which compiler to use. Would it be useful to extend this concept to cover Device toolchains as well? The OpenCL CTS Framework repository previously had the notion of a Device Toolchain described here: https://github.com/KhronosGroup/OpenCL-CTS-Framework/tree/master/03-conformance-checks
Some of the variables that were used in that repository are documented below: