forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (27 loc) · 937 Bytes
/
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
find_package(LuaJIT)
find_program(LUAJIT luajit)
if (LUAJIT_LIBRARIES AND LUAJIT)
FILE(GLOB_RECURSE SRC_LUA
${CMAKE_CURRENT_SOURCE_DIR}/bcc/*.lua
${CMAKE_CURRENT_SOURCE_DIR}/bcc/vendor/*.lua
${CMAKE_CURRENT_SOURCE_DIR}/bpf/*.lua)
ADD_CUSTOM_COMMAND(
OUTPUT bcc.lua
COMMAND ${LUAJIT} ${CMAKE_CURRENT_SOURCE_DIR}/src/squish.lua ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${SRC_LUA} ${CMAKE_CURRENT_SOURCE_DIR}/squishy
)
ADD_CUSTOM_COMMAND(
OUTPUT bcc.o
COMMAND ${LUAJIT} -bg bcc.lua bcc.o
DEPENDS bcc.lua
)
include_directories(${LUAJIT_INCLUDE_DIR})
add_executable(bcc-lua src/main.c bcc.o)
set_target_properties(bcc-lua PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(bcc-lua ${LUAJIT_LIBRARIES})
target_link_libraries(bcc-lua ${bcc-lua-static})
if (NOT COMPILER_NOPIE_FLAG EQUAL "")
target_link_libraries(bcc-lua ${COMPILER_NOPIE_FLAG})
endif()
install(TARGETS bcc-lua RUNTIME DESTINATION bin)
endif()