mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-19 15:11:23 +01:00
Only set SSE/SSE2 flags for 32-bit builds on Windows
They aren't needed for 64-bit since all x86 64-bit processors have these instructions.
This commit is contained in:
@@ -213,6 +213,19 @@ set( CMAKE_LINK_INTERFACE_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
|
||||
# Various common checks whose results are used by the different targets
|
||||
test_big_endian( WORDS_BIGENDIAN )
|
||||
|
||||
# Determine 32-bit or 64-bit target
|
||||
if( CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_VS_PLATFORM_NAME MATCHES "Win64|x64" )
|
||||
set( IS_64BIT ON )
|
||||
elseif( NOT CMAKE_SIZEOF_VOID_P STREQUAL "4" )
|
||||
set( IS_64BIT ON )
|
||||
endif()
|
||||
|
||||
if( IS_64BIT )
|
||||
message( STATUS "Building for 64-bit target" )
|
||||
else()
|
||||
message( STATUS "Building for 32-bit target" )
|
||||
endif()
|
||||
|
||||
# Check for compiler flags
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
|
||||
check_cxx_compiler_flag( "-mmmx" HAVE_MMX )
|
||||
@@ -231,11 +244,16 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
|
||||
endif()
|
||||
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
|
||||
set( HAVE_MMX ON )
|
||||
set( MMX_FLAG "" )
|
||||
set( HAVE_SSE ON )
|
||||
set( SSE_FLAG "/arch:SSE" )
|
||||
set( HAVE_SSE2 ON )
|
||||
set( SSE2_FLAG "/arch:SSE2" )
|
||||
set( MMX_FLAG "" )
|
||||
if( IS_64BIT )
|
||||
set( SSE_FLAG "" )
|
||||
set( SSE2_FLAG "" )
|
||||
else()
|
||||
set( SSE_FLAG "/arch:SSE" )
|
||||
set( SSE2_FLAG "/arch:SSE2" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_include_files( "float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS )
|
||||
|
||||
Reference in New Issue
Block a user