CMakeISPCInformation.cmake 2.4 KB

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