Ryan Prichard | 7aea7e9 | 2022-01-13 17:30:17 -0800 | [diff] [blame] | 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
| 2 | # file Copyright.txt or https://cmake.org/licensing for details. |
| 3 | |
| 4 | |
| 5 | |
| 6 | if(CMAKE_ISPC_COMPILER_FORCED) |
| 7 | # The compiler configuration was forced by the user. |
| 8 | # Assume the user has configured all compiler information. |
| 9 | set(CMAKE_ISPC_COMPILER_WORKS TRUE) |
| 10 | return() |
| 11 | endif() |
| 12 | |
| 13 | include(CMakeTestCompilerCommon) |
| 14 | |
| 15 | # Make sure we try to compile as a STATIC_LIBRARY |
| 16 | set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE}) |
| 17 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) |
| 18 | |
| 19 | # # Try to identify the ABI and configure it into CMakeISPCCompiler.cmake |
| 20 | include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) |
| 21 | CMAKE_DETERMINE_COMPILER_ABI(ISPC ${CMAKE_ROOT}/Modules/CMakeISPCCompilerABI.ispc) |
| 22 | if(CMAKE_ISPC_ABI_COMPILED) |
| 23 | # # The compiler worked so skip dedicated test below. |
| 24 | set(CMAKE_ISPC_COMPILER_WORKS TRUE) |
| 25 | message(STATUS "Check for working ISPC compiler: ${CMAKE_ISPC_COMPILER} - skipped") |
| 26 | endif() |
| 27 | |
| 28 | # Re-configure to save learned information. |
| 29 | configure_file( |
| 30 | ${CMAKE_ROOT}/Modules/CMakeISPCCompiler.cmake.in |
| 31 | ${CMAKE_PLATFORM_INFO_DIR}/CMakeISPCCompiler.cmake |
| 32 | @ONLY |
| 33 | ) |
| 34 | include(${CMAKE_PLATFORM_INFO_DIR}/CMakeISPCCompiler.cmake) |
| 35 | |
| 36 | if(CMAKE_ISPC_SIZEOF_DATA_PTR) |
| 37 | foreach(f ${CMAKE_ISPC_ABI_FILES}) |
| 38 | include(${f}) |
| 39 | endforeach() |
| 40 | unset(CMAKE_ISPC_ABI_FILES) |
| 41 | endif() |
| 42 | |
| 43 | set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE}) |