Commit 4e4f93d1 authored by Daniel Krebs's avatar Daniel Krebs
Browse files

cmake: only build GPU library if CUDA is present

parent dd485559
Pipeline #49418 failed with stages
in 49 seconds
add_subdirectory(common)
add_subdirectory(gpu)
set(SOURCES
vlnv.cpp
......@@ -36,7 +35,16 @@ find_package(Threads)
add_library(villas-fpga SHARED ${SOURCES})
target_link_libraries(villas-fpga PUBLIC villas-common)
target_link_libraries(villas-fpga PUBLIC villas-gpu)
# GPU library is optional, check for CUDA presence
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
add_subdirectory(gpu)
target_link_libraries(villas-fpga PUBLIC villas-gpu)
else()
message("No CUDA support, not building GPU library")
endif()
target_compile_definitions(villas-fpga PRIVATE
BUILDID=\"abc\"
......
......@@ -4,7 +4,6 @@ set(SOURCES
logging.cpp
dma.cpp
fifo.cpp
gpu.cpp
# hls.c
# intc.c
# rtds_rtt.c
......@@ -13,6 +12,10 @@ set(SOURCES
graph.cpp
)
if(CMAKE_CUDA_COMPILER)
list(APPEND SOURCES gpu.cpp)
endif()
add_executable(unit-tests ${SOURCES})
find_package(Criterion REQUIRED)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment