Added /arch:SSE2 flag

This commit is contained in:
Vitaly Kirsanov 2019-04-12 23:11:06 +03:00 committed by Erik de Castro Lopo
parent aa96297d78
commit 8610c3acfb
2 changed files with 15 additions and 10 deletions

View File

@ -81,8 +81,8 @@ add_compile_options(
$<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:-fstack-protector>
$<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:--param>
$<$<AND:$<BOOL:${HAVE_SSP_FLAG}>,$<BOOL:${ENABLE_SSP}>>:ssp-buffer-size=4>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:HAVE_WEFFCXX_FLAG>>:-Weffc++>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:HAVE_DECL_AFTER_STMT_FLAG>>:-Wdeclaration-after-statement>)
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:${HAVE_WEFFCXX_FLAG}>>:-Weffc++>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND HAVE_STACKREALIGN_FLAG)
add_compile_options(-mstackrealign)

View File

@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 3.12)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86(_64)?|(AMD|amd)64|i[346]86")
option(WITH_AVX "Enable AVX, AVX2 optimizations" ON)
option(WITH_SSE "Enable AVX, AVX2 optimizations" ON)
endif()
check_c_compiler_flag(-msse2 HAVE_MSSE2_FLAG)
if(HAVE_MSSE2_FLAG AND WITH_SSE)
add_compile_options(-msse2)
endif()
option(WITH_ASM "Use any assembly optimization routines" ON)
@ -50,10 +44,21 @@ if(NOT WITH_ASM)
add_compile_definitions(FLAC__NO_ASM)
endif()
if(WITH_ASM AND IA32 AND CMAKE_ASM_NASM_COMPILER)
add_subdirectory(ia32)
if(IA32)
if(WITH_ASM AND CMAKE_ASM_NASM_COMPILER)
add_subdirectory(ia32)
endif()
option(WITH_SSE "Enable SSE2 optimizations" ON)
check_c_compiler_flag(-msse2 HAVE_MSSE2_FLAG)
if(WITH_SSE)
add_compile_options(
$<$<BOOL:${HAVE_MSSE2_FLAG}>:-msse2>
$<$<BOOL:${MSVC}>:/arch:SSE2>)
endif()
endif()
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")