1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-16 23:51:18 +02:00

Bug 2400 - Mac: Zoomed in, playback meters slow to respond.

This commit is contained in:
Leland Lucius
2020-05-10 02:36:28 -05:00
parent 4daae34181
commit 4b1d5c376d
2 changed files with 38 additions and 1 deletions

View File

@@ -184,3 +184,23 @@ function( nuget_package dir name version )
# Return the package directory name to the caller
set( ${dir} "${pkgdir}" PARENT_SCOPE )
endfunction()
# Determines if the linker supports the "-platform_version" argument
# on macOS.
macro( check_for_platform_version )
if( NOT DEFINED LINKER_SUPPORTS_PLATFORM_VERSION )
execute_process(
COMMAND
ld -platform_version macos 1.1 1.1
ERROR_VARIABLE
error
)
if( error MATCHES ".*unknown option.*" )
set( PLATFORM_VERSION_SUPPORTED no CACHE INTERNAL "" )
else()
set( PLATFORM_VERSION_SUPPORTED yes CACHE INTERNAL "" )
endif()
endif()
endmacro()

View File

@@ -1187,6 +1187,23 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
POST_BUILD
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
# Bug 2400 workaround
#
# Replaces the SDK version in the built executable with 10.13 to
# prevent high CPU usage and slow drawing on Mojave or newer
check_for_platform_version()
if( PLATFORM_VERSION_SUPPORTED )
list( APPEND LDFLAGS
PRIVATE
-Wl,-platform_version,macos,10.7,10.13
)
else()
list( APPEND LDFLAGS
PRIVATE
-Wl,-sdk_version,10.13
)
endif()
# Define Mac specific resources
list( APPEND MAC_RESOURCES
../mac/Resources/Audacity.icns
@@ -1356,7 +1373,7 @@ target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ${MAC_RESOU
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_options( "${TARGET}" PRIVATE ${LDFLAGS} )
target_link_options( ${TARGET} PRIVATE ${LDFLAGS} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
if( PRECOMP )