File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 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)
2121 if (WITH_AVX AND MSVC )
2222 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)
2323 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 ()
2434else ()
2535 check_cpu_arch_arm64(FLAC__CPU_ARM64)
2636 if (FLAC__CPU_ARM64)
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ static char *posixly_correct;
221221/* Avoid depending on library functions or files
222222 whose names are inconsistent. */
223223
224- #ifndef getenv
224+ #if !defined( getenv ) && !(defined( __clang__ ) && defined( _MSC_VER ))
225225extern char * getenv (const char * name );
226226#endif
227227
You can’t perform that action at this time.
0 commit comments