Skip to content

Commit 708f554

Browse files
committed
Add flag to build compiler options with G++ on macOS.
Building with G++ on Darwin breaks when either AVX, AVX2, or SSE4.1 compiler option is set, unless G++ is actually CLANG. This commit allows to build with G++, by asking G++ to delegate assembly to the clang integrated assembler, instead of the GNU one.
1 parent 742a087 commit 708f554

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

configure.ac

+15
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ if $sse41; then
131131
AM_CONDITIONAL([SSE41_OPT], true)
132132
fi
133133

134+
# Add platform-specific flags for the supported compiler options.
135+
if $avx -o $avx2 -o $sse41; then
136+
case "${host_os}" in
137+
*darwin* | *-macos10*)
138+
if test -z "$CLANG"; then
139+
echo "MODIFYING FLAGS"
140+
# When using AVX, AVX2, or SSE4.1:
141+
# Must tell AS to use clang integrated assembler,
142+
# instead of the GNU based system assembler.
143+
CXXFLAGS="$CXXFLAGS -Wa,-q"
144+
fi
145+
;;
146+
esac
147+
fi
148+
134149
includedir="${includedir}/tesseract"
135150

136151
AC_ARG_WITH([extra-includes],

0 commit comments

Comments
 (0)