-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (34 loc) · 1.21 KB
/
CMakeLists.txt
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
39
40
41
42
43
cmake_minimum_required(VERSION 2.8)
project(MoonGen C CXX)
#Options are defined in libmoon/CMakeLists.txt
set(CMAKE_CXX_FLAGS "-fno-stack-protector -Wall -Wextra -Wno-unused-parameter -g -O3 -std=gnu++11 -march=native -msse4.2")
set(CMAKE_C_FLAGS "-fno-stack-protector -Wall -Wextra -Wno-unused-parameter -g -O3 -std=gnu11 -march=native -msse4.2")
set(CMAKE_EXE_LINKER_FLAGS "-rdynamic")
set(LIBMOON_BUILD_LIBRARY true)
add_definitions(-DLIBMOON_LUA_MAIN_MODULE="moongen-main")
add_subdirectory(libmoon)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/include
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/deps/luajit/src
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/lib
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/src
)
set(files
src/moongen-main
src/software-timestamping
src/crc-rate-limiter
src/software-rate-limiter
)
set(libraries
-Wl,--whole-archive
moon
)
link_directories(
${CMAKE_CURRENT_BINARY_DIR}/libmoon
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/deps/dpdk/x86_64-native-linuxapp-gcc/lib
${CMAKE_CURRENT_SOURCE_DIR}/libmoon/deps/luajit/usr/local/lib
)
add_executable(MoonGen ${files})
target_link_libraries(MoonGen ${libraries})