summaryrefslogtreecommitdiff
path: root/share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2022-01-13 17:30:19 -0800
committerRyan Prichard <rprichard@google.com>2022-01-13 17:31:05 -0800
commitf6283abb0a655968016437be07d04370fd815e6c (patch)
tree939c8ec9b01b0e533cd19239f516224369ef9d0b /share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake
parent38f8f35a5d463a866584b900146cc2986c6d16bc (diff)
downloadwindows-x86-f6283abb0a655968016437be07d04370fd815e6c.tar.gz
Fusion2: http://fusion2/2669b740-21e9-4d31-99f2-25f047c33f53 GCS path: gs://ndk-kokoro-release-artifacts/prod/ndk/cmake/windows_release/3/20211215-131021 Prebuilt updated using: ndk/scripts/update_kokoro_prebuilts.py Test: Treehugger, Kokoro presubmit Bug: http://b/213946898 Change-Id: Ie5521d3e7002eae5824acc69c0368ef328245d8e
Diffstat (limited to 'share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake')
-rw-r--r--share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake43
1 files changed, 43 insertions, 0 deletions
diff --git a/share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake b/share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake
new file mode 100644
index 0000000..6b16393
--- /dev/null
+++ b/share/cmake-3.22/Modules/CMakeTestISPCCompiler.cmake
@@ -0,0 +1,43 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+
+if(CMAKE_ISPC_COMPILER_FORCED)
+ # The compiler configuration was forced by the user.
+ # Assume the user has configured all compiler information.
+ set(CMAKE_ISPC_COMPILER_WORKS TRUE)
+ return()
+endif()
+
+include(CMakeTestCompilerCommon)
+
+# Make sure we try to compile as a STATIC_LIBRARY
+set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+
+# # Try to identify the ABI and configure it into CMakeISPCCompiler.cmake
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+CMAKE_DETERMINE_COMPILER_ABI(ISPC ${CMAKE_ROOT}/Modules/CMakeISPCCompilerABI.ispc)
+if(CMAKE_ISPC_ABI_COMPILED)
+# # The compiler worked so skip dedicated test below.
+ set(CMAKE_ISPC_COMPILER_WORKS TRUE)
+ message(STATUS "Check for working ISPC compiler: ${CMAKE_ISPC_COMPILER} - skipped")
+endif()
+
+# Re-configure to save learned information.
+configure_file(
+ ${CMAKE_ROOT}/Modules/CMakeISPCCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeISPCCompiler.cmake
+ @ONLY
+ )
+include(${CMAKE_PLATFORM_INFO_DIR}/CMakeISPCCompiler.cmake)
+
+if(CMAKE_ISPC_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_ISPC_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_ISPC_ABI_FILES)
+endif()
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE})