Commit 8d575db 1 parent e14acb9 commit 8d575db Copy full SHA for 8d575db
File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ if(FLAC__CPU_X86_64 OR FLAC__CPU_IA32)
21
21
if (WITH_AVX AND MSVC )
22
22
set_source_files_properties (fixed_intrin_avx2.c lpc_intrin_avx2.c stream_encoder_intrin_avx2.c lpc_intrin_fma.c PROPERTIES COMPILE_FLAGS /arch:AVX2)
23
23
endif ()
24
+ if (WITH_AVX AND WIN32 AND CMAKE_C_COMPILER_ID MATCHES "Clang" )
25
+ cmake_policy (PUSH)
26
+ cmake_policy (SET CMP0075 NEW)
27
+ check_include_file("unistd.h" HAVE_UNISTD_H)
28
+ if (NOT HAVE_UNISTD_H)
29
+ # Clang on Windows using MSVC headers
30
+ set_source_files_properties (fixed_intrin_avx2.c lpc_intrin_avx2.c stream_encoder_intrin_avx2.c lpc_intrin_fma.c PROPERTIES COMPILE_FLAGS -mavx2)
31
+ endif ()
32
+ cmake_policy (POP)
33
+ endif ()
24
34
else ()
25
35
check_cpu_arch_arm64(FLAC__CPU_ARM64)
26
36
if (FLAC__CPU_ARM64)
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ static char *posixly_correct;
221
221
/* Avoid depending on library functions or files
222
222
whose names are inconsistent. */
223
223
224
- #ifndef getenv
224
+ #if !defined( getenv ) && !(defined( __clang__ ) && defined( _MSC_VER ))
225
225
extern char * getenv (const char * name );
226
226
#endif
227
227
You can’t perform that action at this time.
0 commit comments