aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/uhd-dpdk/CMakeLists.txt
blob: 0beb1eed51371079d3de02687b7549e4a5262607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# Copyright 2018 Ettus Research, a National Instruments Company
#
# SPDX-License-Identifier: GPL-3.0
#

########################################################################
# Add the subdirectories
########################################################################
if(ENABLE_DPDK)
    if(NOT DEFINED UHD_DPDK_CFLAGS)
        message(STATUS "")
        set(UHD_DPDK_CFLAGS "-march=native"
            CACHE STRING "CFLAGS to use when building uhd-dpdk sources")
        message(STATUS "DPDK: Using default UHD_DPDK_CFLAGS=" ${UHD_DPDK_CFLAGS})
    endif(NOT DEFINED UHD_DPDK_CFLAGS)

    include_directories(${CMAKE_CURRENT_SOURCE_DIR})

    LIBUHD_APPEND_SOURCES(
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_driver.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_fops.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_udp.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_wait.c
    )
    set_source_files_properties(
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_driver.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_fops.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_udp.c
        ${CMAKE_CURRENT_SOURCE_DIR}/uhd_dpdk_wait.c
        PROPERTIES COMPILE_FLAGS "${UHD_DPDK_CFLAGS} -D_GNU_SOURCE"
    )
    include_directories(${DPDK_INCLUDE_DIR})
    LIBUHD_APPEND_LIBS(${DPDK_LIBRARIES})
endif(ENABLE_DPDK)