mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-25 22:28:17 +08:00
adding code to Linux-only samples to guard against building on Windows
This commit is contained in:
@@ -14,6 +14,7 @@ endif()
|
||||
# Include directories and libraries
|
||||
include_directories(../../../Common)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Source file
|
||||
# Add target for fluidsGLES
|
||||
add_executable(fluidsGLES fluidsGLES.cu)
|
||||
@@ -23,3 +24,6 @@ target_compile_options(fluidsGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-
|
||||
target_compile_features(fluidsGLES PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(fluidsGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
else()
|
||||
message(STATUS "Will not build sample fluidsGLES - requires Linux OS")
|
||||
endif()
|
||||
@@ -14,12 +14,16 @@ endif()
|
||||
# Include directories and libraries
|
||||
include_directories(../../../Common)
|
||||
|
||||
# Source file
|
||||
# Add target for nbody_opengles
|
||||
add_executable(nbody_opengles nbody_opengles.cu)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Source file
|
||||
# Add target for nbody_opengles
|
||||
add_executable(nbody_opengles nbody_opengles.cu)
|
||||
|
||||
target_compile_options(nbody_opengles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
target_compile_options(nbody_opengles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(nbody_opengles PRIVATE cxx_std_17 cuda_std_17)
|
||||
target_compile_features(nbody_opengles PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(nbody_opengles PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
set_target_properties(nbody_opengles PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
else()
|
||||
message(STATUS "Will not build sample nbody_opengles - requires Linux OS")
|
||||
endif()
|
||||
|
||||
@@ -14,12 +14,16 @@ endif()
|
||||
# Include directories and libraries
|
||||
include_directories(../../../Common)
|
||||
|
||||
# Source file
|
||||
# Add target for simpleGLES
|
||||
add_executable(simpleGLES simpleGLES.cu)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Source file
|
||||
# Add target for simpleGLES
|
||||
add_executable(simpleGLES simpleGLES.cu)
|
||||
|
||||
target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17)
|
||||
target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
else()
|
||||
message(STATUS "Will not build sample simpleGLES - requires Linux OS")
|
||||
endif()
|
||||
@@ -14,12 +14,16 @@ endif()
|
||||
# Include directories and libraries
|
||||
include_directories(../../../Common)
|
||||
|
||||
# Source file
|
||||
# Add target for simpleGLES_EGLOutput
|
||||
add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Source file
|
||||
# Add target for simpleGLES_EGLOutput
|
||||
add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu)
|
||||
|
||||
target_compile_options(simpleGLES_EGLOutput PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
target_compile_options(simpleGLES_EGLOutput PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(simpleGLES_EGLOutput PRIVATE cxx_std_17 cuda_std_17)
|
||||
target_compile_features(simpleGLES_EGLOutput PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(simpleGLES_EGLOutput PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
set_target_properties(simpleGLES_EGLOutput PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
else()
|
||||
message(STATUS "Will not build sample simpleGLES_EGLOutput - requires Linux OS")
|
||||
endif()
|
||||
Reference in New Issue
Block a user