summaryrefslogtreecommitdiffstats
path: root/Tests/ISPC/DynamicLibrary/CMakeLists.txt
blob: 59f875ec6c0b5ac4fd5195dbfb5fc1597188a45e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

cmake_minimum_required(VERSION 3.18)
project(ISPCDynamicLibrary CXX ISPC)

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
  set(CMAKE_ISPC_FLAGS "--arch=x86")
endif()


add_library(ispc_objects1 STATIC extra.ispc extra.cxx)
add_library(ispc_objects2 SHARED simple.ispc)

set_target_properties(ispc_objects1 PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(ispc_objects1 PROPERTIES ISPC_INSTRUCTION_SETS "avx1-i32x16;avx2-i32x4")
set_target_properties(ispc_objects2 PROPERTIES ISPC_INSTRUCTION_SETS "avx1-i32x16")

target_link_libraries(ispc_objects2 PRIVATE ispc_objects1)

add_executable(ISPCDynamicLibrary main.cxx)
target_link_libraries(ISPCDynamicLibrary PUBLIC ispc_objects2)