Skip to content

Commit

Permalink
Fix cmake search of LLVM and Clang.
Browse files Browse the repository at this point in the history
In some Linux distrubutions with multiple LLVM/Clang versions
instaled Clad detect wrong (and uncompatioble) versions of
LLVM and Clang.
  • Loading branch information
alexander-penev authored and vgvassilev committed Dec 13, 2020
1 parent 213bfbd commit f0bbf90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
set(LLVM_DIR ${Clang_DIR})
endif()

## Set Cmake packages search order

set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)

## Find supported LLVM

if (LLVM_FOUND)
Expand Down Expand Up @@ -78,9 +83,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )

## Find supported Clang

set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)

if (DEFINED CLANG_VERSION)
if (CLANG_VERSION VERSION_GREATER CLANG_MAX_SUPPORTED)
set(CLANG_VERSION ${CLANG_MAX_SUPPORTED})
Expand Down

0 comments on commit f0bbf90

Please sign in to comment.