From 6f58cb8294b1f52f960e0d7bde3d71a163193da4 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 12 Feb 2021 14:42:37 -0500 Subject: [PATCH] Hoist the generation of the config header into top CMakeLists... ... Because it depends on having visited various lib-src directories, which I want to delay until visiting various of the modules, and I also want to visit src before the modules, because that's bottom-up dependency ordering. So the step should not be done in src. --- CMakeLists.txt | 11 +++++++++++ src/CMakeLists.txt | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91d3a686e..69447bfcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,6 +433,17 @@ add_subdirectory( "plug-ins" ) add_subdirectory( "src" ) add_subdirectory( "scripts" ) +# Generate config file, which is included by Audacity.h +if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + configure_file( src/audacity_config.h.in src/private/configwin.h ) +elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set( HAVE_VISIBILITY 1 ) + configure_file( src/audacity_config.h.in src/private/configmac.h ) +else() + set( HAVE_VISIBILITY 1 ) + configure_file( src/audacity_config.h.in src/private/configunix.h ) +endif() + # Uncomment what follows for symbol values. #[[ get_cmake_property( _variableNames VARIABLES ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91c78a6e1..5b2b1daef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1105,9 +1105,6 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) ../win/audacity.rc ) - # Create the config file - configure_file( audacity_config.h.in private/configwin.h ) - # Copy over the wxWidgets DLLs if( ${_OPT}use_wxwidgets STREQUAL "system" ) set( wxlibs "$ENV{WXWIN}" ) @@ -1205,10 +1202,6 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) # Use the Aqua theme set( USE_AQUA_THEME 1 ) - # Create the config file - set( HAVE_VISIBILITY 1 ) - configure_file( audacity_config.h.in private/configmac.h ) - # Copy the required wxWidgets libs into the bundle add_custom_command( TARGET @@ -1233,10 +1226,6 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) else() set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" ) - # Create the config file - set( HAVE_VISIBILITY 1 ) - configure_file( audacity_config.h.in private/configunix.h ) - # Build the list of mimetypes # # (Don't use generator expressions since it will leave null/empty