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

Better node names for 3p libraries in picture of dependencies

This commit is contained in:
Paul Licameli
2021-06-07 09:36:02 -04:00
parent fddbb4b7a9
commit e2fda7df32
2 changed files with 15 additions and 3 deletions

View File

@@ -301,6 +301,19 @@ function( export_symbol_define var module_name )
set( "${var}" "${symbol}=${value}" PARENT_SCOPE )
endfunction()
# shorten a target name for purposes of generating a dependency graph picture
function( canonicalize_node_name var node )
# strip generator expressions
string( REGEX REPLACE ".*>.*:(.*)>" "\\1" node "${node}" )
# omit the "-interface" for alias targets to modules
string( REGEX REPLACE "-interface\$" "" node "${node}" )
# shorten names of standard libraries or Apple frameworks
string( REGEX REPLACE "^-(l|framework )" "" node "${node}" )
# shorten paths
get_filename_component( node "${node}" NAME_WE )
set( "${var}" "${node}" PARENT_SCOPE )
endfunction()
function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
ADDITIONAL_DEFINES ADDITIONAL_LIBRARIES LIBTYPE )
@@ -454,7 +467,7 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
if(IMPORT IN_LIST ACCESS)
continue()
endif()
string( REGEX REPLACE "-interface\$" "" IMPORT "${IMPORT}" )
canonicalize_node_name(IMPORT "${IMPORT}")
list( APPEND GRAPH_EDGES "\"${TARGET}\" -> \"${IMPORT}\"" )
endforeach()
set( GRAPH_EDGES "${GRAPH_EDGES}" PARENT_SCOPE )