mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-23 00:00:01 +01:00
88 lines
1.6 KiB
CMake
88 lines
1.6 KiB
CMake
add_subdirectory(common)
|
|
|
|
set(SOURCES
|
|
vlnv.cpp
|
|
card.cpp
|
|
ip.cpp
|
|
ip_node.cpp
|
|
|
|
ips/timer.cpp
|
|
ips/switch.cpp
|
|
ips/fifo.cpp
|
|
ips/intc.cpp
|
|
ips/pcie.cpp
|
|
ips/dma.cpp
|
|
ips/bram.cpp
|
|
ips/rtds.cpp
|
|
|
|
ips/rtds2gpu/rtds2gpu.cpp
|
|
ips/rtds2gpu/xrtds2gpu.c
|
|
ips/rtds2gpu/gpu2rtds.cpp
|
|
|
|
kernel/kernel.c
|
|
kernel/pci.c
|
|
kernel/vfio.cpp
|
|
|
|
utils.c
|
|
list.c
|
|
log.c
|
|
log_config.c
|
|
log_helper.c
|
|
)
|
|
|
|
# we don't have much influence on drivers generated by Xilinx, so ignore warnings
|
|
set_source_files_properties(ips/rtds2gpu/xrtds2gpu.c
|
|
PROPERTIES COMPILE_FLAGS -Wno-int-to-pointer-cast)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(JANSSON jansson)
|
|
pkg_check_modules(XIL libxil)
|
|
|
|
find_package(Threads)
|
|
|
|
add_library(villas-fpga SHARED ${SOURCES})
|
|
|
|
target_link_libraries(villas-fpga PUBLIC villas-common)
|
|
|
|
# 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\"
|
|
_GNU_SOURCE
|
|
)
|
|
|
|
target_include_directories(villas-fpga
|
|
PUBLIC
|
|
../include
|
|
${XIL_INCLUDE_DIRS}
|
|
${JANSSON_INCLUDE_DIRS}
|
|
)
|
|
|
|
target_link_libraries(villas-fpga PUBLIC
|
|
${XIL_LIBRARIES}
|
|
${JANSSON_LIBRARIES}
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
${CMAKE_DL_LIBS}
|
|
m
|
|
)
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
install(TARGETS villas-fpga
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static
|
|
)
|
|
|
|
install(DIRECTORY ../include/villas DESTINATION include)
|
|
|
|
|