1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-15 15:11:12 +02:00

CopyLibs.cmake, for macOS: visit unique EDGES (not nodes)...

... in the graph of library dependencies.

Necessary to avoid crashes on startup loading dynamic libraries, but sufficient
to avoid excessive build times with many libraries.
This commit is contained in:
Paul Licameli
2021-06-06 22:36:21 -04:00
parent e83c66ee50
commit e785c77226

View File

@@ -40,8 +40,8 @@ endfunction()
set( VISITED )
function( gather_libs src )
list( APPEND VISITED "${src}" )
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" )
list( APPEND VISITED "${src}" )
execute( output cmd /k dumpbin /dependents ${src} )
foreach( line ${output} )
@@ -72,7 +72,8 @@ function( gather_libs src )
set( lib "${WXWIN}/${dylib_name}" )
if( NOT lib STREQUAL "${src}" AND NOT line MATCHES "@executable" AND EXISTS "${lib}"
AND NOT "${lib}" IN_LIST VISITED )
AND NOT "${src}///${lib}" IN_LIST VISITED )
list( APPEND VISITED "${src}///${lib}" )
message(STATUS "\tProcessing ${lib}...")
list( APPEND libs ${lib} )
@@ -88,6 +89,7 @@ function( gather_libs src )
endif()
endforeach()
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" )
list( APPEND VISITED "${src}" )
message(STATUS "Executing LD_LIBRARY_PATH='${WXWIN}' ldd ${src}")
execute( output sh -c "LD_LIBRARY_PATH='${WXWIN}' ldd ${src}" )