Skip to content

Commit

Permalink
cmake: Allow any LLVM release for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
danobi committed Sep 19, 2024
1 parent 8db6cbe commit 3438e03
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ else()
endif()

set(MIN_LLVM_MAJOR 13)
set(MAX_LLVM_MAJOR 18)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# We assume bpftrace is not being packaged when CMAKE_BUILD_TYPE=Debug.
# So allow building with any LLVM version. This is purely for developers.
# Packagers are highly discouraged from shipping bpftrace with untested LLVM
# releases.
set(MAX_LLVM_MAJOR 999)
else()
set(MAX_LLVM_MAJOR 18)
endif()

if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
Expand Down

0 comments on commit 3438e03

Please sign in to comment.