Merge topic 'cuda_add_12.8_new_sm_support'
[kiteware-cmake.git] / Modules / CMakeISPCInformation.cmake
blob4a4b72aa467da18a892046007c3f1583638f3623
1 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 if(UNIX)
5   set(CMAKE_ISPC_OUTPUT_EXTENSION .o)
6 else()
7   set(CMAKE_ISPC_OUTPUT_EXTENSION .obj)
8 endif()
9 set(CMAKE_INCLUDE_FLAG_ISPC "-I")
11 # Load compiler-specific information.
12 if(CMAKE_ISPC_COMPILER_ID)
13   include(Compiler/${CMAKE_ISPC_COMPILER_ID}-ISPC OPTIONAL)
14 endif()
16 # load the system- and compiler specific files
17 if(CMAKE_ISPC_COMPILER_ID)
18   # load a hardware specific file, mostly useful for embedded compilers
19   if(CMAKE_SYSTEM_PROCESSOR)
20     include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ISPC_COMPILER_ID}-ISPC-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
21   endif()
22   include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ISPC_COMPILER_ID}-ISPC OPTIONAL)
23 endif()
25 # add the flags to the cache based
26 # on the initial values computed in the platform/*.cmake files
27 # use _INIT variables so that this only happens the first time
28 # and you can set these flags in the cmake cache
29 set(CMAKE_ISPC_FLAGS_INIT "$ENV{ISPCFLAGS} ${CMAKE_ISPC_FLAGS_INIT}")
31 cmake_initialize_per_config_variable(CMAKE_ISPC_FLAGS "Flags used by the ISPC compiler")
33 if(CMAKE_ISPC_STANDARD_LIBRARIES_INIT)
34   set(CMAKE_ISPC_STANDARD_LIBRARIES "${CMAKE_ISPC_STANDARD_LIBRARIES_INIT}"
35     CACHE STRING "Libraries linked by default with all ISPC applications.")
36   mark_as_advanced(CMAKE_ISPC_STANDARD_LIBRARIES)
37 endif()
39 if(NOT CMAKE_ISPC_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_ISPC_COMPILER_LAUNCHER})
40   set(CMAKE_ISPC_COMPILER_LAUNCHER "$ENV{CMAKE_ISPC_COMPILER_LAUNCHER}"
41     CACHE STRING "Compiler launcher for ISPC.")
42 endif()
44 include(CMakeCommonLanguageInclude)
46 # now define the following rules:
47 # CMAKE_ISPC_COMPILE_OBJECT
49 # Create a static archive incrementally for large object file counts.
50 if(NOT DEFINED CMAKE_ISPC_ARCHIVE_CREATE)
51   set(CMAKE_ISPC_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
52 endif()
53 if(NOT DEFINED CMAKE_ISPC_ARCHIVE_APPEND)
54   set(CMAKE_ISPC_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
55 endif()
56 if(NOT DEFINED CMAKE_ISPC_ARCHIVE_FINISH)
57   set(CMAKE_ISPC_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
58 endif()
60 if(NOT CMAKE_ISPC_COMPILE_OBJECT)
61   set(CMAKE_ISPC_COMPILE_OBJECT
62     "<CMAKE_ISPC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> --emit-obj <SOURCE> -h <ISPC_HEADER>")
63 endif()
65 set(CMAKE_ISPC_USE_LINKER_INFORMATION FALSE)
67 set(CMAKE_ISPC_INFORMATION_LOADED 1)