Skip to content

Commit

Permalink
fix ci for llvm library
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwei37 committed Apr 15, 2024
1 parent 1e21fd6 commit d1df7ca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-llvm-jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: build llvm JIT/AOT as a standalone library
run: |
cd vm/llvm-jit &&\
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBPFTIME_BUILD_STANDALONE_LLVM_VM=YES &&\
cmake -B build -DCMAKE_BUILD_TYPE=Release &&\
cmake --build build --target all -j
- name: build vm as a standalone library
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer")

SET(BPFTIME_BUILD_WITH_LLVM_VM 1)
#
# Project details
#
Expand Down
6 changes: 3 additions & 3 deletions vm/compat/include/bpftime_vm_compat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class bpftime_vm_impl {
*/
virtual bool toggle_bounds_check(bool enable)
{
SPDLOG_CRITICAL("Not implemented yet: toggle_bounds_check");
SPDLOG_WARN("Not implemented yet: toggle_bounds_check");
return false;
}
/**
Expand All @@ -52,7 +52,7 @@ class bpftime_vm_impl {
virtual void register_error_print_callback(int (*fn)(FILE *,
const char *, ...))
{
SPDLOG_CRITICAL(
SPDLOG_WARN(
"Not implemented yet: register_error_print_callback");
}
/**
Expand Down Expand Up @@ -142,7 +142,7 @@ class bpftime_vm_impl {
*/
virtual int set_pointer_secret(uint64_t secret)
{
SPDLOG_CRITICAL("Not implemented yet: set_pointer_secret");
SPDLOG_WARN("Not implemented yet: set_pointer_secret");
return -1;
}
/**
Expand Down
14 changes: 10 additions & 4 deletions vm/llvm-jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,30 @@ if(NOT DEFINED SPDLOG_INCLUDE)
set(SPDLOG_INCLUDE ../../third_party/spdlog/include)
endif()

if(${BPFTIME_BUILD_STANDALONE_LLVM_VM})
# if BPFTIME_BUILD_WITH_LLVM_VM is set, then it's built in the bpftime project.
# If not, it's built as a standalone library.
if(${BPFTIME_BUILD_WITH_LLVM_VM})
# only build cli in the main project because it relies on libbpf
add_subdirectory(cli)
else()
if(${BPFTIME_ENABLE_UNIT_TESTING})
add_subdirectory(../../third_party/Catch2 ${CMAKE_CURRENT_BINARY_DIR}/Catch2)
endif()
add_subdirectory(../compat ${CMAKE_CURRENT_BINARY_DIR}/compat)
endif()

message(STATUS "LLVM_LIBS=${LLVM_LIBS}")
find_package(Boost REQUIRED)

target_link_libraries(bpftime_llvm_jit_vm PUBLIC ${LLVM_LIBS} bpftime_vm_compat PRIVATE spdlog::spdlog)
target_include_directories(bpftime_llvm_jit_vm
PUBLIC ${LLVM_INCLUDE_DIRS} ${SPDLOG_INCLUDE} ${Boost_INCLUDE} ../include include #LLVM jit also used these headers
target_include_directories(bpftime_llvm_jit_vm
PUBLIC ${LLVM_INCLUDE_DIRS} ${SPDLOG_INCLUDE} ${Boost_INCLUDE} ../include include #LLVM jit also used these headers
)
add_dependencies(bpftime_llvm_jit_vm bpftime_vm_compat spdlog::spdlog)

if(BPFTIME_ENABLE_UNIT_TESTING)
message(STATUS "Build unit tests for the project. Tests should always be found in the test folder\n")
add_subdirectory(unit-test)
endif()

add_subdirectory(example)
add_subdirectory(cli)

0 comments on commit d1df7ca

Please sign in to comment.