mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
Print the llvm-config path on configuration error
This is helpful on systems with multiple LLVM installations. For example, OpenBSD ships with LLVM in the base system, but without support for extra targets. A full LLVM version can be installed using the ports system, but even when it is, `cmake` is not going to pick it up unless `/usr/local` is explicitly added to the `cmake` search paths. Having the full `llvm-config` path printed on error is helpful to understand that the detected LLVM version was not the expected one.
This commit is contained in:
parent
a502604702
commit
99c5d2d590
@ -55,13 +55,13 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 10)
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
|
||||
endif()
|
||||
if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 11)
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
|
||||
endif()
|
||||
if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 11)
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
|
||||
message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
@ -72,7 +72,7 @@ elseif("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
|
||||
function(NEED_TARGET TARGET_NAME)
|
||||
list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
|
||||
if (${_index} EQUAL -1)
|
||||
message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
|
||||
message(FATAL_ERROR "LLVM (according to ${LLVM_CONFIG_EXE}) is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
|
||||
endif()
|
||||
endfunction(NEED_TARGET)
|
||||
NEED_TARGET("AArch64")
|
||||
|
Loading…
Reference in New Issue
Block a user