diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-06-30 14:13:53 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-08-28 15:21:31 (GMT) |
commit | e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a (patch) | |
tree | b59fe2e01365d0ec14d79f38be8bede5afde6a62 /Tests/ISPC/ResponseAndDefine | |
parent | 34cc6acc81758e29f8c88607c21ab11d8807f87c (diff) | |
download | CMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.zip CMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.tar.gz CMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.tar.bz2 |
ISPC: Support ISPC header generation byproducts and parallel builds
Diffstat (limited to 'Tests/ISPC/ResponseAndDefine')
-rw-r--r-- | Tests/ISPC/ResponseAndDefine/CMakeLists.txt | 28 | ||||
-rw-r--r-- | Tests/ISPC/ResponseAndDefine/main.cxx | 2 | ||||
-rw-r--r-- | Tests/ISPC/ResponseAndDefine/simple.ispc | 2 |
3 files changed, 18 insertions, 14 deletions
diff --git a/Tests/ISPC/ResponseAndDefine/CMakeLists.txt b/Tests/ISPC/ResponseAndDefine/CMakeLists.txt index 0dc5320..7539209 100644 --- a/Tests/ISPC/ResponseAndDefine/CMakeLists.txt +++ b/Tests/ISPC/ResponseAndDefine/CMakeLists.txt @@ -1,5 +1,5 @@ - -project(ispc_spaces_in_path) +cmake_minimum_required(VERSION 3.18) +project(ispc_spaces_in_path ISPC CXX) set(CMAKE_NINJA_FORCE_RESPONSE_FILE ON) @@ -10,15 +10,19 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/path with spaces/simple_include.h" " ) -add_executable(SpacesInPath main.cxx simple.ispc) -set_target_properties(SpacesInPath PROPERTIES POSITION_INDEPENDENT_CODE ON) -target_include_directories(SpacesInPath PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") +add_executable(ISPCResponseAndDefine main.cxx simple.ispc) +set_target_properties(ISPCResponseAndDefine PROPERTIES POSITION_INDEPENDENT_CODE ON) +target_include_directories(ISPCResponseAndDefine PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") + +target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") +endif() + -target_compile_options(SpacesInPath PRIVATE - "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4;--arch=x86-64>") -target_compile_definitions(SpacesInPath PRIVATE - "$<$<COMPILE_LANGUAGE:ISPC>:STRUCT_DEFINE=\"struct{uniform int a;varying int b;\";M_PI=3.1415926535f>") -target_include_directories(SpacesInPath PRIVATE - "$<$<COMPILE_LANGUAGE:ISPC>:\"fake path with spaces\">"" - "$<$<COMPILE_LANGUAGE:ISPC>:\"path with spaces\">") +target_compile_definitions(ISPCResponseAndDefine PRIVATE + "$<$<COMPILE_LANGUAGE:ISPC>:STRUCT_DEFINE=struct{uniform int a>;M_PI=3.14159f") +target_include_directories(ISPCResponseAndDefine PRIVATE + "$<$<COMPILE_LANGUAGE:ISPC>:${CMAKE_CURRENT_BINARY_DIR}/fake path with spaces>" + "$<$<COMPILE_LANGUAGE:ISPC>:${CMAKE_CURRENT_BINARY_DIR}/path with spaces>") diff --git a/Tests/ISPC/ResponseAndDefine/main.cxx b/Tests/ISPC/ResponseAndDefine/main.cxx index a6b91a6..4f1c9be 100644 --- a/Tests/ISPC/ResponseAndDefine/main.cxx +++ b/Tests/ISPC/ResponseAndDefine/main.cxx @@ -1,6 +1,6 @@ #include <stdio.h> -#include "simple_ispc.h" +#include "simple.ispc.h" int main() { diff --git a/Tests/ISPC/ResponseAndDefine/simple.ispc b/Tests/ISPC/ResponseAndDefine/simple.ispc index 3f32c37..81fd7ca 100644 --- a/Tests/ISPC/ResponseAndDefine/simple.ispc +++ b/Tests/ISPC/ResponseAndDefine/simple.ispc @@ -1,5 +1,5 @@ -STRUCT_DEFINE}; +STRUCT_DEFINE;}; #include "simple_include.h" |