numam/CMakeLists.txt

58 lines
1.7 KiB
CMake
Raw Normal View History

2020-11-13 14:46:27 +00:00
cmake_minimum_required(VERSION 3.0)
2020-11-17 01:07:50 +00:00
find_program(CC_GCC gcc)
find_program(CXX_GCC g++)
set(CMAKE_C_COMPILER ${CC_GCC})
set(CMAKE_CXX_COMPILER ${CXX_GCC})
2020-11-13 14:46:27 +00:00
project(khat)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
find_package(dpdk REQUIRED)
2021-01-28 10:24:59 +00:00
find_package(Hwloc REQUIRED)
2020-11-13 14:46:27 +00:00
2020-11-18 01:01:55 +00:00
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)
2020-11-13 14:46:27 +00:00
2021-01-28 10:24:59 +00:00
2020-11-13 14:46:27 +00:00
include_directories(${CMAKE_SOURCE_DIR}/inc)
include_directories(${dpdk_INCLUDE_DIRS})
2021-01-28 10:24:59 +00:00
include_directories(${Hwloc_INCLUDE_DIRS})
2020-11-13 14:46:27 +00:00
set(LIBNM_CC_FLAGS -O2 -g -Wall -Wextra -Werror -std=c++11)
set(LIBNTR_C_FLAGS -O2 -g -Wall -Wextra -Werror -std=c11)
set(LIBGEN_CC_FLAGS -O2 -g -Wall -Wextra -Werror -std=c++11)
set(KHAT_LINKLIBS pthread nm ntr)
set(CAT_LINKLIBS pthread nm ntr gen)
set(RAT_LINKLIBS pthread nm ntr gen)
2021-01-28 10:24:59 +00:00
add_library(nm libnm/nm.cc)
target_link_libraries(nm ${Hwloc_LIBRARIES})
target_compile_options(nm PRIVATE ${LIBNM_CC_FLAGS})
2020-11-13 14:46:27 +00:00
2021-01-28 10:24:59 +00:00
add_library(ntr libntr/ntr.c)
target_compile_options(ntr PRIVATE ${LIBNTR_C_FLAGS})
2020-11-13 14:46:27 +00:00
add_library(gen libgen/generator.cc)
target_link_libraries(gen ${Hwloc_LIBRARIES})
target_compile_options(gen PRIVATE ${LIBGEN_CC_FLAGS})
add_executable(khat khat/khat.cc)
target_link_libraries(khat ${dpdk_LIBRARIES} ${KHAT_LINKLIBS})
2020-11-13 14:46:27 +00:00
target_compile_options(khat PRIVATE ${CC_FLAGS})
add_executable(cat cat/cat.cc)
target_link_libraries(cat ${dpdk_LIBRARIES} ${CAT_LINKLIBS})
2020-11-13 14:46:27 +00:00
target_compile_options(cat PRIVATE ${CC_FLAGS})
add_executable(rat rat/rat.cc)
target_link_libraries(rat ${dpdk_LIBRARIES} ${RAT_LINKLIBS})
target_compile_options(rat PRIVATE ${CC_FLAGS})