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,9 +14,9 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file
# Add target for systemWideAtomics (Linux-only)
if(NOT WIN32)
# Add target for systemWideAtomics
add_executable(systemWideAtomics systemWideAtomics.cu)
target_compile_options(systemWideAtomics PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
@@ -24,4 +24,7 @@ if(NOT WIN32)
target_compile_features(systemWideAtomics PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(systemWideAtomics PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample systemWideAtomics - requires Linux OS")
endif()