Skip to content

Commit 6f58047

Browse files
alfgclaude
andcommitted
fix: skip cmake compiler check for x265 on MSYS2
cmake 4.x has a try-compile bug on MSYS2/MINGW64 where it generates a ninja build file but fails to write testCCompiler.c before invoking ninja, causing an immediate build failure. Skip the check with CMAKE_C/CXX_COMPILER_WORKS=1 since gcc is proven working at this point. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 40703d7 commit 6f58047

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

scripts/_ports/x265.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,20 @@ rm -rf "$BUILD_DIR"
7272
mkdir -p "$BUILD_DIR"
7373
cd "$BUILD_DIR"
7474

75-
# Configure extra flags for macOS (assembly causes linker issues with Xcode 26+)
75+
# Configure extra flags per platform
7676
EXTRA_X265_FLAGS=()
77-
if [[ "$(uname -s)" == "Darwin" ]]; then
78-
EXTRA_X265_FLAGS+=(-DENABLE_ASSEMBLY=OFF)
79-
[[ "$(uname -m)" == "arm64" ]] && EXTRA_X265_FLAGS+=(-DENABLE_NEON=OFF)
80-
fi
77+
case "$(uname -s)" in
78+
Darwin*)
79+
# Assembly causes linker issues with Xcode 26+
80+
EXTRA_X265_FLAGS+=(-DENABLE_ASSEMBLY=OFF)
81+
[[ "$(uname -m)" == "arm64" ]] && EXTRA_X265_FLAGS+=(-DENABLE_NEON=OFF)
82+
;;
83+
MINGW*|MSYS*|CYGWIN*)
84+
# cmake 4.x try-compile is broken on MSYS2/MINGW64; skip the check since
85+
# we know gcc works (x264 already compiled successfully before this step)
86+
EXTRA_X265_FLAGS+=(-DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1)
87+
;;
88+
esac
8189

8290
# Configure and build
8391
cmake -G Ninja \

0 commit comments

Comments
 (0)