File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,24 @@ endif()
51
51
52
52
# Set BpfObject input parameters -- note this is usually not necessary unless
53
53
# you're in a highly vendored environment (like libbpf-bootstrap)
54
+ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" )
55
+ set (ARCH "x86" )
56
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" )
57
+ set (ARCH "arm" )
58
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64" )
59
+ set (ARCH "arm64" )
60
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le" )
61
+ set (ARCH "powerpc" )
62
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips" )
63
+ set (ARCH "mips" )
64
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64" )
65
+ set (ARCH "riscv" )
66
+ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64" )
67
+ set (ARCH "loongarch" )
68
+ endif ()
69
+
54
70
set (BPFOBJECT_BPFTOOL_EXE ${CMAKE_CURRENT_BINARY_DIR} /bpftool/bootstrap/bpftool )
55
- set (BPFOBJECT_VMLINUX_H ${CMAKE_CURRENT_SOURCE_DIR} /../../vmlinux/vmlinux.h )
71
+ set (BPFOBJECT_VMLINUX_H ${CMAKE_CURRENT_SOURCE_DIR} /../../vmlinux/${ARCH}/ vmlinux.h )
56
72
set (LIBBPF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} /libbpf )
57
73
set (LIBBPF_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR} /libbpf/libbpf.a )
58
74
find_package (BpfObject REQUIRED )
You can’t perform that action at this time.
0 commit comments