Skip to content

Commit 4ccbb9f

Browse files
committed
configure: Check support of compile flags with -Werror
gcc fails if an unsupported compile flag is given, but clang and clang++ normally only emit a warning "argument unused during compilation". The old test had accepted flags like -mavx for clang++ on non Intel hosts. This resulted in build failures because Intel code was included. Now the check runs with -Werror, and unsupported flags are detected as an error. This fixes the build problem with clang++ on non Intel hosts. Signed-off-by: Stefan Weil <[email protected]>
1 parent b6bfb20 commit 4ccbb9f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

configure.ac

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@ AM_CONDITIONAL([AVX2_OPT], false)
117117
AM_CONDITIONAL([SSE41_OPT], false)
118118
AM_CONDITIONAL([MARCH_NATIVE_OPT], false)
119119

120-
AX_CHECK_COMPILE_FLAG([-mavx], [avx=true], [avx=false])
120+
AX_CHECK_COMPILE_FLAG([-mavx], [avx=true], [avx=false], [-Werror])
121121
if $avx; then
122122
AM_CONDITIONAL([AVX_OPT], true)
123123
fi
124124

125-
AX_CHECK_COMPILE_FLAG([-mavx2], [avx2=true], [avx2=false])
125+
AX_CHECK_COMPILE_FLAG([-mavx2], [avx2=true], [avx2=false], [-Werror])
126126
if $avx2; then
127127
AM_CONDITIONAL([AVX2_OPT], true)
128128
fi
129129

130-
AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false])
130+
AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false], [-Werror])
131131
if $sse41; then
132132
AM_CONDITIONAL([SSE41_OPT], true)
133133
fi
134134

135-
AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=true], [arch_native=false])
135+
AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=true], [arch_native=false], [-Werror])
136136
if $arch_native; then
137137
AM_CONDITIONAL([MARCH_NATIVE_OPT], true)
138138
fi
@@ -337,12 +337,12 @@ dnl **********************
337337
338338
CPLUSPLUS=
339339
340-
AX_CHECK_COMPILE_FLAG([-std=c++11], [cplusplus11=true], [cplusplus11=false])
340+
AX_CHECK_COMPILE_FLAG([-std=c++11], [cplusplus11=true], [cplusplus11=false], [-Werror])
341341
if $cplusplus11; then
342342
CPLUSPLUS=11
343343
fi
344344
345-
AX_CHECK_COMPILE_FLAG([-std=c++14], [cplusplus14=true], [cplusplus14=false])
345+
AX_CHECK_COMPILE_FLAG([-std=c++14], [cplusplus14=true], [cplusplus14=false], [-Werror])
346346
if $cplusplus14; then
347347
CPLUSPLUS=14
348348
fi

0 commit comments

Comments
 (0)