summaryrefslogtreecommitdiffstats
path: root/Tests/ISPC/SystemIncludes/CMakeLists.txt
blob: 3b4c28962a2a8dc5a665f82dac541863333d84d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cmake_minimum_required(VERSION 3.18)
project(ispc_spaces_in_path ISPC CXX)


add_executable(ISPCSystemIncludes main.cxx simple.ispc)
set_target_properties(ISPCSystemIncludes PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(ISPCSystemIncludes PROPERTIES ISPC_HEADER_SUFFIX ".ispc.h")
target_include_directories(ISPCSystemIncludes SYSTEM PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")

if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
  target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=neon-i32x4>")
else()
  target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>")
  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
    target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>")
  endif()
endif()