1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 00:20:06 +02:00

Move definition of AUDACITY_DLL_API into src/CMakeLists.txt

This commit is contained in:
Paul Licameli 2021-05-08 07:05:33 -04:00 committed by Leland Lucius
parent b9ca0acb4a
commit f2b53c82eb
4 changed files with 5 additions and 91 deletions

View File

@ -790,60 +790,4 @@ using EffectFamilySymbol = ComponentInterfaceSymbol;
// the API is complete.
#if !defined(AUDACITY_DLL_API)
// This was copied from "Audacity.h" so these headers wouldn't have
// to include it.
/* Magic for dynamic library import and export. This is unfortunately
* compiler-specific because there isn't a standard way to do it. Currently it
* works with the Visual Studio compiler for windows, and for GCC 4+. Anything
* else gets all symbols made public, which gets messy */
/* The Visual Studio implementation */
#ifdef _MSC_VER
#ifndef AUDACITY_DLL_API
#ifdef BUILDING_AUDACITY
#define AUDACITY_DLL_API _declspec(dllexport)
#else
#ifdef _DLL
#define AUDACITY_DLL_API _declspec(dllimport)
#else
#define AUDACITY_DLL_API
#endif
#endif
#endif
#endif //_MSC_VER
/* The GCC-elf implementation */
#ifdef HAVE_VISIBILITY // this is provided by the configure script, is only
// enabled for suitable GCC versions
/* The incantation is a bit weird here because it uses ELF symbol stuff. If we
* make a symbol "default" it makes it visible (for import or export). Making it
* "hidden" means it is invisible outside the shared object. */
#ifndef AUDACITY_DLL_API
#ifdef BUILDING_AUDACITY
#define AUDACITY_DLL_API __attribute__((visibility("default")))
#else
#define AUDACITY_DLL_API __attribute__((visibility("default")))
#endif
#endif
#endif
/* The GCC-win32 implementation */
// bizzarely, GCC-for-win32 supports Visual Studio style symbol visibility, so
// we use that if building on Cygwin
#if defined __CYGWIN__ && defined __GNUC__
#ifndef AUDACITY_DLL_API
#ifdef BUILDING_AUDACITY
#define AUDACITY_DLL_API _declspec(dllexport)
#else
#ifdef _DLL
#define AUDACITY_DLL_API _declspec(dllimport)
#else
#define AUDACITY_DLL_API
#endif
#endif
#endif
#endif
#endif
#endif // __AUDACITY_TYPES_H__

View File

@ -113,37 +113,6 @@ class wxWindow;
#include "configwin.h"
#endif
/* The dynamic library import and export for Microsoft Windows.
* Supported by Visual Studio and for GCC 4+ */
#if defined _WIN32 || (defined __CYGWIN__ && defined __GNUC__)
#ifndef AUDACITY_DLL_API
#ifdef BUILDING_AUDACITY
#define AUDACITY_DLL_API __declspec(dllexport)
#else
#ifdef _DLL
#define AUDACITY_DLL_API __declspec(dllimport)
#else
#define AUDACITY_DLL_API
#endif
#endif
#endif
#endif //_WIN32 || (__CYGWIN__ && __GNUC__)
/* The GCC-elf implementation */
#ifdef HAVE_VISIBILITY // this is provided by the configure script, is only
// enabled for suitable GCC versions
/* The incantation is a bit weird here because it uses ELF symbol stuff. If we
* make a symbol "default" it makes it visible (for import or export). Making it
* "hidden" means it is invisible outside the shared object. */
#ifndef AUDACITY_DLL_API
#ifdef BUILDING_AUDACITY
#define AUDACITY_DLL_API __attribute__((visibility("default")))
#else
#define AUDACITY_DLL_API __attribute__((visibility("default")))
#endif
#endif
#endif
// This renames a good use of this C++ keyword that we don't need to review when hunting for leaks.
#define PROHIBITED = delete

View File

@ -1293,6 +1293,11 @@ source_group(
${_INTDIR}/CMakeFiles/Audacity.dir/cmake_pch.hxx
)
# Define AUDACITY_DLL_API
import_symbol_define( import_symbol AUDACITY_DLL )
export_symbol_define( export_symbol AUDACITY_DLL )
list( APPEND DEFINES PRIVATE "${export_symbol}" INTERFACE "${import_symbol}" )
target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ${MAC_RESOURCES} ${WIN_RESOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )

View File

@ -19,10 +19,6 @@ custom controls.
#include <wx/filedlg.h> // to inherit
#ifndef AUDACITY_DLL_API
#define AUDACITY_DLL_API
#endif
class AUDACITY_DLL_API FileDialogBase : public wxFileDialogBase
{
public: