mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-27 01:19:31 -05:00
c9a50f3556
The target property `ISPC_HEADER_SUFFIX` and associated global variable now can control the suffix used when generating the C/C++ interoperability ISPC headers. In addition the default suffix is now "_ispc.h" which matches the common convention that the ISPC compiler team uses and recommends.
24 lines
664 B
CMake
24 lines
664 B
CMake
|
|
cmake_minimum_required(VERSION 3.18)
|
|
project(ISPCCustomHeaderSuffix CXX ISPC)
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
set(CMAKE_ISPC_FLAGS "--arch=x86")
|
|
endif()
|
|
|
|
set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16")
|
|
|
|
set(CMAKE_ISPC_HEADER_SUFFIX ".ispc.h")
|
|
|
|
add_library(ispc_suffix_1 OBJECT simple.ispc)
|
|
add_library(ispc_suffix_2 OBJECT extra.ispc)
|
|
|
|
set_target_properties(ispc_suffix_2 PROPERTIES ISPC_HEADER_SUFFIX "___ispc.h")
|
|
|
|
set_target_properties(ispc_suffix_1 ispc_suffix_2
|
|
PROPERTIES POSITION_INDEPENDENT_CODE ON
|
|
)
|
|
|
|
add_executable(ISPCCustomHeaderSuffix main.cxx extra.cxx)
|
|
target_link_libraries(ISPCCustomHeaderSuffix PRIVATE ispc_suffix_1 ispc_suffix_2)
|