diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml index 19693908f..c0dd086d7 100644 --- a/.github/workflows/cmake_build.yml +++ b/.github/workflows/cmake_build.yml @@ -136,6 +136,14 @@ jobs: export WXWIN="${WXWIN//\\//}" # Configure Audacity + # + # The wxWidgets_USE_REL_AND_DBG is needed because, + # on Github, we only build the Release version of + # wxWidgets and the FindwxWidgets CMake module + # defaults to looking for both. If either of them + # isn't found, then it doesn't provides the required + # library information. This is only a concern for + # Windows. cmake -S . \ -B build \ -G "${{matrix.config.generator}}" \ diff --git a/cmake-proxies/mod-null/CMakeLists.txt b/cmake-proxies/mod-null/CMakeLists.txt index aa55e4f9a..bb9b1e417 100644 --- a/cmake-proxies/mod-null/CMakeLists.txt +++ b/cmake-proxies/mod-null/CMakeLists.txt @@ -19,6 +19,16 @@ list( APPEND INCLUDES ${TARGET_ROOT} ) +list( APPEND DEFINES + PRIVATE + # This is needed until the transition to cmake is complete and + # the Windows pragmas are removed from ModNullCallback.cpp. + # Without it, the wxWidgets "debug.h" will define __WXDEBUG__ + # which then causes this module to emit library pragmas for the + # debug versions of wxWidgets...even if the build if for Release. + wxDEBUG_LEVEL=0 +) + list( APPEND LIBRARIES PRIVATE Audacity @@ -34,6 +44,7 @@ set_target_properties( ${TARGET} organize_source( "${TARGET_ROOT}" "" "${SOURCES}" ) target_sources( ${TARGET} PRIVATE ${SOURCES} ) +target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} ) target_include_directories( ${TARGET} PRIVATE ${INCLUDES} ) target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} ) diff --git a/cmake-proxies/mod-nyq-bench/CMakeLists.txt b/cmake-proxies/mod-nyq-bench/CMakeLists.txt index afc4c11ba..7a6c2972e 100644 --- a/cmake-proxies/mod-nyq-bench/CMakeLists.txt +++ b/cmake-proxies/mod-nyq-bench/CMakeLists.txt @@ -19,6 +19,16 @@ list( APPEND INCLUDES ${TARGET_ROOT} ) +list( APPEND DEFINES + PRIVATE + # This is needed until the transition to cmake is complete and + # the Windows pragmas are removed from NyqBench.cpp. Without + # it, the wxWidgets "debug.h" will define __WXDEBUG__ which + # then causes this module to emit library pragmas for the debug + # versions of wxWidgets...even if the build if for Release. + wxDEBUG_LEVEL=0 +) + list( APPEND LIBRARIES PRIVATE Audacity @@ -36,6 +46,7 @@ set_target_properties( ${TARGET} organize_source( "${TARGET_ROOT}" "" "${SOURCES}" ) target_sources( ${TARGET} PRIVATE ${SOURCES} ) +target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} ) target_include_directories( ${TARGET} PRIVATE ${INCLUDES} ) target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} ) diff --git a/cmake-proxies/mod-script-pipe/CMakeLists.txt b/cmake-proxies/mod-script-pipe/CMakeLists.txt index ba98f1583..89690af82 100644 --- a/cmake-proxies/mod-script-pipe/CMakeLists.txt +++ b/cmake-proxies/mod-script-pipe/CMakeLists.txt @@ -22,6 +22,13 @@ list( APPEND INCLUDES list( APPEND DEFINES PRIVATE BUILDING_SCRIPT_PIPE + + # This is needed until the transition to cmake is complete and + # the Windows pragmas are removed from ScripterCallback.cpp. + # Without it, the wxWidgets "debug.h" will define __WXDEBUG__ + # which then causes this module to emit library pragmas for the + # debug versions of wxWidgets...even if the build if for Release. + wxDEBUG_LEVEL=0 ) list( APPEND LIBRARIES diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b7f9c891d..8b4fb40af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1104,14 +1104,17 @@ set( PKGLIBDIR "${_LIBDIR}" ) set( LIBDIR "${_LIBDIR}" ) set( HAVE_GTK ${GTK_FOUND} ) -if( "${${_OPT}use_lame}" STREQUAL "local" ) -# Something is wrong in ExportMP3 when this is defined. -# fix it and then uncomment this. -# set( DISABLE_DYNAMIC_LOADING_LAME YES ) -endif() +# Do not define these for Windows or Mac until further testing +# can be done against ExportMP3.cpp. If either are defined, the +# build will fail. +if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin" ) + if( "${${_OPT}use_lame}" STREQUAL "local" ) + set( DISABLE_DYNAMIC_LOADING_LAME YES ) + endif() -if( "${${_OPT}use_ffmpeg}" STREQUAL "linked" ) - set( DISABLE_DYNAMIC_LOADING_FFMPEG YES ) + if( "${${_OPT}use_ffmpeg}" STREQUAL "linked" ) + set( DISABLE_DYNAMIC_LOADING_FFMPEG YES ) + endif() endif() if( CMAKE_SYSTEM_NAME MATCHES "Windows" )