Changes for building for aarch64, specifically jetson orin nano

This commit is contained in:
Jonathan Bentz
2025-01-08 17:05:45 -06:00
parent 1e0c660f22
commit a1cf9e4183
15 changed files with 189 additions and 120 deletions

View File

@@ -20,25 +20,29 @@ find_package(GLUT)
# Source file
if(${OpenGL_FOUND})
if (${GLUT_FOUND})
# Add target for simpleCUDA2GL
add_executable(simpleCUDA2GL simpleCUDA2GL.cu main.cpp)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
message(STATUS "Will not build sample simpleCUDA2GL - not supported on aarch64")
else()
# Add target for simpleCUDA2GL
add_executable(simpleCUDA2GL simpleCUDA2GL.cu main.cpp)
target_compile_options(simpleCUDA2GL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_options(simpleCUDA2GL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleCUDA2GL PRIVATE cxx_std_17 cuda_std_17)
target_compile_features(simpleCUDA2GL PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleCUDA2GL PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(simpleCUDA2GL PUBLIC
${OPENGL_INCLUDE_DIR}
${CUDAToolkit_INCLUDE_DIRS}
${GLUT_INCLUDE_DIRS}
)
set_target_properties(simpleCUDA2GL PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_include_directories(simpleCUDA2GL PUBLIC
${OPENGL_INCLUDE_DIR}
${CUDAToolkit_INCLUDE_DIRS}
${GLUT_INCLUDE_DIRS}
)
target_link_libraries(simpleCUDA2GL
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)
endif()
else()
message(STATUS "GLUT not found - will not build sample 'simpleCUDA2GL'")
endif()