adding code to Linux-only samples to guard against building on Windows

This commit is contained in:
Jonathan Bentz
2024-12-18 14:36:12 -06:00
parent fcd39008ec
commit f9dd4323af
11 changed files with 158 additions and 117 deletions

View File

@@ -14,16 +14,20 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# Source file
# Add target for simpleCUFFT_callback
add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file
# Add target for simpleCUFFT_callback
add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu)
target_compile_options(simpleCUFFT_callback PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_options(simpleCUFFT_callback PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleCUFFT_callback PRIVATE cxx_std_17 cuda_std_17)
target_compile_features(simpleCUFFT_callback PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleCUFFT_callback PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(simpleCUFFT_callback PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(simpleCUFFT_callback PRIVATE
CUDA::cufft
)
target_link_libraries(simpleCUFFT_callback PRIVATE
CUDA::cufft
)
else()
message(STATUS "Will not build sample simpleCUFFT_callback - requires Linux OS")
endif()