File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1111,6 +1111,32 @@ endif()
1111
1111
if (FLB_IN_EBPF)
1112
1112
find_package (PkgConfig)
1113
1113
1114
+ # Check for Clang compiler
1115
+ find_program (CLANG_EXECUTABLE clang)
1116
+
1117
+ if (CLANG_EXECUTABLE)
1118
+ message (STATUS "Clang found: ${CLANG_EXECUTABLE} " )
1119
+ # Get Clang version
1120
+ execute_process (
1121
+ COMMAND ${CLANG_EXECUTABLE} --version
1122
+ OUTPUT_VARIABLE CLANG_VERSION_OUTPUT
1123
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
1124
+ )
1125
+ if (CLANG_VERSION_OUTPUT MATCHES "clang version ([0-9]+)\\ .([0-9]+)\\ .([0-9]+)" )
1126
+ set (CLANG_VERSION_MAJOR "${CMAKE_MATCH_1} " )
1127
+ set (CLANG_VERSION_MINOR "${CMAKE_MATCH_2} " )
1128
+ set (CLANG_VERSION_PATCH "${CMAKE_MATCH_3} " )
1129
+
1130
+ message (STATUS "Detected Clang version: ${CLANG_VERSION_MAJOR} .${CLANG_VERSION_MINOR} .${CLANG_VERSION_PATCH} " )
1131
+ # Check if Clang version is at least 3.7.0
1132
+ if (CLANG_VERSION_MAJOR LESS 3 AND CLANG_VERSION_MINOR LESS 7)
1133
+ message (FATAL_ERROR "Clang version must be at least 3.7.0, but found ${CLANG_VERSION_MAJOR} .${CLANG_VERSION_MINOR} .${CLANG_VERSION_PATCH} " )
1134
+ endif ()
1135
+ endif ()
1136
+ else ()
1137
+ message (FATAL_ERROR "Clang not found! Please install Clang version >= 3.7.0!" )
1138
+ endif ()
1139
+
1114
1140
# Check for libbpf with pkg-config
1115
1141
pkg_check_modules(LIBBPF libbpf>=0.5.0)
1116
1142
You can’t perform that action at this time.
0 commit comments