Skip to content

Commit 93a0480

Browse files
Pinterfqyot27
authored andcommitted
avscore CMakeList: support mingw by qyot27, avx/avx2 for specific files for mingw
1 parent 1c11f6b commit 93a0480

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

avs_core/CMakeLists.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,23 @@ foreach(FILE ${AvsCore_Sources})
2929
source_group("${GROUP}" FILES "${FILE}")
3030
endforeach()
3131

32-
# special AVX option for source files with *_avx.cpp pattern
33-
file(GLOB_RECURSE SRCS_AVX "*_avx.cpp")
34-
set_source_files_properties(${SRCS_AVX} PROPERTIES COMPILE_FLAGS " /arch:AVX ")
32+
if (MSVC_IDE)
33+
# special AVX option for source files with *_avx.cpp pattern
34+
file(GLOB_RECURSE SRCS_AVX "*_avx.cpp")
35+
set_source_files_properties(${SRCS_AVX} PROPERTIES COMPILE_FLAGS " /arch:AVX ")
36+
37+
# special AVX2 option for source files with *_avx2.cpp pattern
38+
file(GLOB_RECURSE SRCS_AVX2 "*_avx2.cpp")
39+
set_source_files_properties(${SRCS_AVX2} PROPERTIES COMPILE_FLAGS " /arch:AVX2 ")
40+
elseif (MINGW)
41+
# special AVX option for source files with *_avx.cpp pattern
42+
file(GLOB_RECURSE SRCS_AVX "*_avx.cpp")
43+
set_source_files_properties(${SRCS_AVX} PROPERTIES COMPILE_FLAGS -mavx )
3544

36-
# special AVX2 option for source files with *_avx2.cpp pattern
37-
file(GLOB_RECURSE SRCS_AVX2 "*_avx2.cpp")
38-
set_source_files_properties(${SRCS_AVX2} PROPERTIES COMPILE_FLAGS " /arch:AVX2 ")
45+
# special AVX2 option for source files with *_avx2.cpp pattern
46+
file(GLOB_RECURSE SRCS_AVX2 "*_avx2.cpp")
47+
set_source_files_properties(${SRCS_AVX2} PROPERTIES COMPILE_FLAGS -mavx2 )
48+
endif()
3949

4050
# Specify include directories
4151
target_include_directories("AvsCore" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)

0 commit comments

Comments
 (0)