From 30a2edc4a382ed760eaace2fcd0b042c226d10d4 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 11 Aug 2007 08:29:23 +0000 Subject: [PATCH] (initial) win32 export support git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@698835 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- taglib/CMakeLists.txt | 9 +++++++-- taglib/audioproperties.h | 4 +++- taglib/fileref.h | 3 ++- taglib/tag.h | 3 ++- taglib/taglib_export.h | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 taglib/taglib_export.h diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt index 03b73052..8c5f072b 100644 --- a/taglib/CMakeLists.txt +++ b/taglib/CMakeLists.txt @@ -118,7 +118,12 @@ if(ZLIB_FOUND) TARGET_LINK_LIBRARIES(tag ${ZLIB_LIBRARIES}) endif(ZLIB_FOUND) -SET_TARGET_PROPERTIES(tag PROPERTIES VERSION 1.4.0 SOVERSION 1 INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) +SET_TARGET_PROPERTIES(tag PROPERTIES + VERSION 1.4.0 + SOVERSION 1 + INSTALL_NAME_DIR ${LIB_INSTALL_DIR} + DEFINE_SYMBOL MAKE_TAGLIB_LIB +) INSTALL(TARGETS tag DESTINATION ${LIB_INSTALL_DIR} ) -INSTALL( FILES tag.h fileref.h audioproperties.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) +INSTALL( FILES tag.h fileref.h audioproperties.h taglib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}/taglib) diff --git a/taglib/audioproperties.h b/taglib/audioproperties.h index 23c69617..662729f7 100644 --- a/taglib/audioproperties.h +++ b/taglib/audioproperties.h @@ -22,6 +22,8 @@ #ifndef TAGLIB_AUDIOPROPERTIES_H #define TAGLIB_AUDIOPROPERTIES_H +#include "taglib_export.h" + namespace TagLib { //! A simple, abstract interface to common audio properties @@ -33,7 +35,7 @@ namespace TagLib { * interface that is sufficient for most applications. */ - class AudioProperties + class TAGLIB_EXPORT AudioProperties { public: diff --git a/taglib/fileref.h b/taglib/fileref.h index 74f3ac7c..60db1425 100644 --- a/taglib/fileref.h +++ b/taglib/fileref.h @@ -24,6 +24,7 @@ #include +#include "taglib_export.h" #include "audioproperties.h" namespace TagLib { @@ -52,7 +53,7 @@ namespace TagLib { * \see addFileTypeResolver() */ - class FileRef + class TAGLIB_EXPORT FileRef { public: diff --git a/taglib/tag.h b/taglib/tag.h index 46999a9a..a4669418 100644 --- a/taglib/tag.h +++ b/taglib/tag.h @@ -22,6 +22,7 @@ #ifndef TAGLIB_TAG_H #define TAGLIB_TAG_H +#include "taglib_export.h" #include "tstring.h" namespace TagLib { @@ -36,7 +37,7 @@ namespace TagLib { * in TagLib::AudioProperties, TagLib::File and TagLib::FileRef. */ - class Tag + class TAGLIB_EXPORT Tag { public: diff --git a/taglib/taglib_export.h b/taglib/taglib_export.h new file mode 100644 index 00000000..d5370358 --- /dev/null +++ b/taglib/taglib_export.h @@ -0,0 +1,33 @@ +/* + Copyright (c) 2006 Volker Krause + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#ifndef TAGLIB_EXPORT_H +#define TAGLIB_EXPORT_H + +#if defined(_WIN32) || defined(_WIN64) +#ifdef MAKE_TAGLIB_LIB +#define TAGLIB_EXPORT __declspec(dllexport) +#else +#define TAGLIB_EXPORT __declspec(dllimport) +#endif +#else +#define TAGLIB_EXPORT +#endif + +#endif -- 2.40.0