mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-11 17:13:37 +02:00
Fix build time infinite recursion in CopyLibs.cmake
This commit is contained in:
committed by
Paul Licameli
parent
63bde66f65
commit
7d30537374
@@ -6,6 +6,10 @@
|
|||||||
# SRC source library name
|
# SRC source library name
|
||||||
# DST destination directory
|
# DST destination directory
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# enable IN_LIST operator
|
||||||
|
cmake_policy(SET CMP0057 NEW)
|
||||||
|
|
||||||
message( "==================================================================" )
|
message( "==================================================================" )
|
||||||
message( "Copying shared libraries:" )
|
message( "Copying shared libraries:" )
|
||||||
message( "==================================================================" )
|
message( "==================================================================" )
|
||||||
@@ -34,18 +38,20 @@ function( execute )
|
|||||||
set( ${outlist} ${cmd_out} PARENT_SCOPE )
|
set( ${outlist} ${cmd_out} PARENT_SCOPE )
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
set( VISITED )
|
||||||
function( gather_libs src )
|
function( gather_libs src )
|
||||||
|
list( APPEND VISITED "${src}" )
|
||||||
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" )
|
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" )
|
||||||
execute( output cmd /k dumpbin /dependents ${src} )
|
execute( output cmd /k dumpbin /dependents ${src} )
|
||||||
|
|
||||||
foreach( line ${output} )
|
foreach( line ${output} )
|
||||||
set( lib ${WXWIN}/${line} )
|
set( lib ${WXWIN}/${line} )
|
||||||
|
|
||||||
if( EXISTS "${lib}" )
|
if( EXISTS "${lib}" AND NOT "${lib}" IN_LIST VISITED )
|
||||||
list( APPEND libs ${lib} )
|
list( APPEND libs ${lib} )
|
||||||
|
|
||||||
gather_libs( ${lib} )
|
gather_libs( ${lib} )
|
||||||
elseif ( EXISTS "${DST}/${line}" )
|
elseif ( EXISTS "${DST}/${line}" AND NOT "${DST}/${line}" IN_LIST VISITED )
|
||||||
gather_libs( "${DST}/${line}" )
|
gather_libs( "${DST}/${line}" )
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
@@ -65,7 +71,8 @@ function( gather_libs src )
|
|||||||
message(STATUS "Checking out ${line}")
|
message(STATUS "Checking out ${line}")
|
||||||
set( lib "${WXWIN}/${dylib_name}" )
|
set( lib "${WXWIN}/${dylib_name}" )
|
||||||
|
|
||||||
if( NOT lib STREQUAL "${src}" AND NOT line MATCHES "@executable" AND EXISTS "${lib}")
|
if( NOT lib STREQUAL "${src}" AND NOT line MATCHES "@executable" AND EXISTS "${lib}"
|
||||||
|
AND NOT "${lib}" IN_LIST VISITED )
|
||||||
message(STATUS "\tProcessing ${lib}...")
|
message(STATUS "\tProcessing ${lib}...")
|
||||||
|
|
||||||
list( APPEND libs ${lib} )
|
list( APPEND libs ${lib} )
|
||||||
@@ -94,7 +101,7 @@ function( gather_libs src )
|
|||||||
|
|
||||||
set(line "${WXWIN}/${line}")
|
set(line "${WXWIN}/${line}")
|
||||||
|
|
||||||
if (EXISTS "${line}")
|
if (EXISTS "${line}" AND NOT "${line}" IN_LIST VISITED)
|
||||||
message (STATUS "\tAdding ${line}...")
|
message (STATUS "\tAdding ${line}...")
|
||||||
|
|
||||||
set( lib ${line} )
|
set( lib ${line} )
|
||||||
|
Reference in New Issue
Block a user