mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 19:03:28 +00:00
fix
This commit is contained in:
@@ -17,8 +17,20 @@ echo "[*] Output dir: ${OUTPUT_DIR}"
|
|||||||
find_llvm_tool() {
|
find_llvm_tool() {
|
||||||
local tool_name="$1"
|
local tool_name="$1"
|
||||||
|
|
||||||
# macOS: use xcrun
|
# macOS: derive from the same directory as the active clang to guarantee
|
||||||
|
# the profraw format version matches the compiler that instrumented the binary.
|
||||||
if [[ "$(uname)" == "Darwin" ]]; then
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
local clang_path
|
||||||
|
clang_path=$(xcrun --find clang 2>/dev/null)
|
||||||
|
if [[ -n "$clang_path" ]]; then
|
||||||
|
local tool_path
|
||||||
|
tool_path="$(dirname "$clang_path")/${tool_name}"
|
||||||
|
if [[ -x "$tool_path" ]]; then
|
||||||
|
echo "$tool_path"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Fallback: xcrun
|
||||||
if xcrun --find "${tool_name}" &>/dev/null; then
|
if xcrun --find "${tool_name}" &>/dev/null; then
|
||||||
echo "xcrun ${tool_name}"
|
echo "xcrun ${tool_name}"
|
||||||
return 0
|
return 0
|
||||||
@@ -51,6 +63,12 @@ fi
|
|||||||
echo "[*] Using: ${LLVM_PROFDATA}"
|
echo "[*] Using: ${LLVM_PROFDATA}"
|
||||||
echo "[*] Using: ${LLVM_COV}"
|
echo "[*] Using: ${LLVM_COV}"
|
||||||
|
|
||||||
|
# Print version info for debugging version mismatches
|
||||||
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
echo "[*] Compiler: $(xcrun clang --version | head -1)"
|
||||||
|
echo "[*] profdata: $(${LLVM_PROFDATA} show --version 2>&1 | head -1 || true)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Find test binary
|
# Find test binary
|
||||||
if [[ -z "${TEST_BINARY}" ]]; then
|
if [[ -z "${TEST_BINARY}" ]]; then
|
||||||
for path in \
|
for path in \
|
||||||
|
|||||||
Reference in New Issue
Block a user