@@ -62,52 +62,66 @@ function(generate_ll_file)
6262 if (NOT clang)
6363 # Conan deps are available in in PATH
6464 foreach (hint "${LLVM_TOOLS_BINARY_DIR } " "${Clang_INCLUDE_DIR} /../bin" "${LLVM_INCLUDE_DIR} /../bin" "/usr/local/llvm-14/bin" )
65- cmake_path (NORMAL_PATH hint OUTPUT_VARIABLE hint )
65+ if ("${CMAKE_VERSION } " VERSION_GREATER_EQUAL "3.20" )
66+ cmake_path (NORMAL_PATH hint OUTPUT_VARIABLE hint )
67+ endif ()
6668 list (APPEND binary_hint_paths "${hint} " )
6769 endforeach ()
6870 message (STATUS "HINTS to find clang/clang++/opt: ${binary_hint_paths} " )
6971
7072 if ("${CMAKE_VERSION } " VERSION_LESS "3.25" ) # VALIDATOR requires it
71-
73+ message ( WARNING "I would prefer CMake >= 3.25 but I will try my best to resolve deps." )
7274 find_program (clang REQUIRED
7375 NAMES clang-14 clang
7476 HINTS ${binary_hint_paths} )
7577 find_program (clangcpp REQUIRED
76- NAMES clang++
78+ NAMES clang++-14 clang++
7779 HINTS ${binary_hint_paths} )
7880 find_program (opt REQUIRED
79- NAMES opt
81+ NAMES opt-14 opt
8082 HINTS ${binary_hint_paths} )
8183
8284 set (IS_VALID_VERSION "" )
8385 validate_binary_version ("IS_VALID_VERSION" "${clang} " )
8486 if (NOT "${IS_VALID_VERSION} " )
85- message ( FATAL_ERROR "Couldn't find clang in version 14 " )
87+ set ( clang " " )
8688 endif ()
8789 validate_binary_version ("IS_VALID_VERSION" "${clangcpp} " )
8890 if (NOT "${IS_VALID_VERSION} " )
89- message ( FATAL_ERROR "Couldn't find clang++ in version 14 " )
91+ set (clangcpp " " )
9092 endif ()
9193 validate_binary_version ("IS_VALID_VERSION" "${opt} " )
9294 if (NOT "${IS_VALID_VERSION} " )
93- message ( FATAL_ERROR "Couldn't find opt in version 14 " )
95+ set ( opt " " )
9496 endif ()
9597 else ()
9698 find_program (clang REQUIRED
9799 NAMES clang-14 clang
98100 HINTS ${binary_hint_paths}
99101 VALIDATOR validate_binary_version )
100- message (STATUS "found clang binary in \" ${clang} \" " )
101102 find_program (clangcpp REQUIRED
102- NAMES clang++
103+ NAMES clang++-14 clang++
103104 HINTS ${binary_hint_paths}
104105 VALIDATOR validate_binary_version )
105- message (STATUS "found clang binary in \" ${clangpp} \" " )
106106 find_program (opt REQUIRED
107- NAMES opt
107+ NAMES opt-14 opt
108108 HINTS ${binary_hint_paths}
109109 VALIDATOR validate_binary_version )
110- message (STATUS "found clang binary in \" ${opt} \" " )
110+ endif ()
111+ if ("${clang} " STREQUAL "" )
112+ message (FATAL_ERROR "Couldn't find clang in version 14" )
113+ else ()
114+ message (STATUS "found clang binary in \" ${clang} \" " )
115+ endif ()
116+ if ("${clangcpp} " STREQUAL "" )
117+ message (FATAL_ERROR "Couldn't find clang++ in version 14" )
118+ else ()
119+ message (STATUS "found clang++ binary in \" ${clangcpp} \" " )
120+ endif ()
121+ if ("${opt} " STREQUAL "" )
122+ message (FATAL_ERROR "Couldn't find opt in version 14" )
123+ else ()
124+ message (STATUS "found opt binary in \" ${opt} \" " )
111125 endif ()
112126 endif ()
113127
0 commit comments