1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
5 set(CMAKE_ISPC_OUTPUT_EXTENSION .o)
7 set(CMAKE_ISPC_OUTPUT_EXTENSION .obj)
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)
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)
22 include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ISPC_COMPILER_ID}-ISPC OPTIONAL)
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)
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.")
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>")
53 if(NOT DEFINED CMAKE_ISPC_ARCHIVE_APPEND)
54 set(CMAKE_ISPC_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
56 if(NOT DEFINED CMAKE_ISPC_ARCHIVE_FINISH)
57 set(CMAKE_ISPC_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
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>")
65 set(CMAKE_ISPC_USE_LINKER_INFORMATION FALSE)
67 set(CMAKE_ISPC_INFORMATION_LOADED 1)