46 lines
1.3 KiB
CMake
46 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
|
|
find_program(CC_GCC gcc)
|
|
find_program(CXX_GCC g++)
|
|
|
|
set(CMAKE_C_COMPILER ${CC_GCC})
|
|
set(CMAKE_CXX_COMPILER ${CXX_GCC})
|
|
|
|
project(khat)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
|
|
find_package(dpdk REQUIRED)
|
|
find_package(Hwloc REQUIRED)
|
|
|
|
set(CC_FLAGS -O2 -g -Wall -Wextra -Werror -std=c++11
|
|
-Wno-deprecated-declarations
|
|
-Wno-packed-not-aligned
|
|
-Wno-address-of-packed-member
|
|
-Wno-zero-length-array
|
|
-Wno-gnu-zero-variadic-macro-arguments
|
|
-msse4
|
|
-mavx)
|
|
|
|
set(LIBNM_CC_FLAGS -O2 -g -Wall -Wextra -Werror -std=c++11)
|
|
set(LIBNTR_C_FLAGS -O2 -g -Wall -Wextra -Werror -std=c11)
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/inc)
|
|
include_directories(${dpdk_INCLUDE_DIRS})
|
|
include_directories(${Hwloc_INCLUDE_DIRS})
|
|
|
|
add_library(nm libnm/nm.cc)
|
|
target_link_libraries(nm ${Hwloc_LIBRARIES})
|
|
target_compile_options(nm PRIVATE ${LIBNM_CC_FLAGS})
|
|
|
|
add_library(ntr libntr/ntr.c)
|
|
target_compile_options(ntr PRIVATE ${LIBNTR_C_FLAGS})
|
|
|
|
add_executable(khat khat/khat.cc )
|
|
target_link_libraries(khat ${dpdk_LIBRARIES} pthread nm ntr)
|
|
target_compile_options(khat PRIVATE ${CC_FLAGS})
|
|
|
|
add_executable(cat cat/cat.cc cat/generator.cc)
|
|
target_link_libraries(cat ${dpdk_LIBRARIES} pthread nm ntr)
|
|
target_compile_options(cat PRIVATE ${CC_FLAGS})
|
|
|