Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make & cmake build errors on Arch Linux #308

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ include_directories(${AR_INCLUDE_DIR})
find_package(FrontendLLVM REQUIRED)
include_directories(${FRONTEND_LLVM_INCLUDE_DIR})

find_package(LLVM REQUIRED)
find_package(LLVM 14.0.0...<15.0.0 REQUIRED)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it seems like version ranges in find_package are only available since CMake 3.19:
https://cmake.org/cmake/help/latest/command/find_package.html#basic-signature

We currently support cmake 3.4.3 and above, as specified by cmake_minimum_required:
https://github.com/NASA-SW-VnV/ikos/blob/master/analyzer/CMakeLists.txt#L41

We could potentially increase that, although there might be people depending on lower versions.
We could also have two versions of the find_package call depending on the cmake version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed version ranges in 5ab5b3a.

It looks like they were redundant, as FindLLVM.cmake returns the first LLVM version it finds, and it always begins it's search by looking for llvm-config-14.

include_directories(SYSTEM ${LLVM_INCLUDE_DIR})

if ((LLVM_VERSION VERSION_LESS "14") OR (NOT (LLVM_VERSION VERSION_LESS "15")))
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
###############################################################################

if (NOT LLVM_FOUND)
find_program(LLVM_CONFIG_EXECUTABLE CACHE NAMES llvm-config DOC "Path to llvm-config binary")
find_program(LLVM_CONFIG_EXECUTABLE CACHE NAMES llvm-config-14 llvm-config DOC "Path to llvm-config binary")

if (LLVM_CONFIG_EXECUTABLE)
function(run_llvm_config FLAG OUTPUT_VAR)
Expand Down
2 changes: 1 addition & 1 deletion frontend/llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ include_directories(${CORE_INCLUDE_DIR})
find_package(AR REQUIRED)
include_directories(${AR_INCLUDE_DIR})

find_package(LLVM REQUIRED)
find_package(LLVM 14.0.0...<15.0.0 REQUIRED)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR})

if ((LLVM_VERSION VERSION_LESS "14") OR (NOT (LLVM_VERSION VERSION_LESS "15")))
Expand Down