diff --git a/CMakeLists.txt b/CMakeLists.txt index 611e9ec1..44980f85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ if(ENABLE_STATIC) else() set(BUILD_SHARED_LIBS ON) endif() +OPTION(ENABLE_STATIC_RUNTIME "Visual Studio, link with runtime statically" OFF) option(BUILD_TESTS "Build the test suite" OFF) option(BUILD_EXAMPLES "Build the examples" OFF) @@ -34,6 +35,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() +if (MSVC AND ENABLE_STATIC_RUNTIME) + foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endforeach(flag_var) +endif() set(TAGLIB_LIB_MAJOR_VERSION "1") set(TAGLIB_LIB_MINOR_VERSION "7") diff --git a/INSTALL b/INSTALL index 8391c0b3..89a555ab 100644 --- a/INSTALL +++ b/INSTALL @@ -30,7 +30,27 @@ an Universal Binary framework with Mac OS X 10.4 as the deployment target: -DCMAKE_CXX_COMPILER=/usr/bin/c++-4.0 \ -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk/ \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4 \ - -DCMAKE_OSX_ARCHITECTURES="ppc;i368;x86_64" + -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64" + +For a 10.6 Snow Leopard static library, use: + cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 \ + -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \ + -DENABLE_STATIC=ON \ + -DCMAKE_INSTALL_PREFIX="" + +After 'make', and 'make install', add libtag.a to your XCode project, and add +the include folder to the project's User Header Search Paths. + +For Windows with Visual Studio 2010, cd to the taglib folder then: + md build + cd build + cmake -DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON -G "Visual Studio 10" .. + +Including ENABLE_STATIC_RUNTIME=ON indicates you want taglib built using the +static runtime library, rather than the DLL form of the runtime. +cmake will create a Visual Studio solution, taglib.sln that you can open and +build as normal. Unit Tests ---------- diff --git a/taglib/asf/asfpicture.cpp b/taglib/asf/asfpicture.cpp index 5970ea0b..c36ffa3a 100644 --- a/taglib/asf/asfpicture.cpp +++ b/taglib/asf/asfpicture.cpp @@ -35,8 +35,9 @@ using namespace TagLib; -struct ASF::Picture::PicturePriavte : public RefCounter +class ASF::Picture::PicturePrivate : public RefCounter { +public: bool valid; Type type; String mimeType; @@ -50,7 +51,7 @@ struct ASF::Picture::PicturePriavte : public RefCounter ASF::Picture::Picture() { - d = new PicturePriavte(); + d = new PicturePrivate(); d->valid = true; } diff --git a/taglib/asf/asfpicture.h b/taglib/asf/asfpicture.h index 5c1bfbfd..aa0a060c 100644 --- a/taglib/asf/asfpicture.h +++ b/taglib/asf/asfpicture.h @@ -208,8 +208,8 @@ namespace TagLib friend class Attribute; #endif private: - struct PicturePriavte; - PicturePriavte *d; + class PicturePrivate; + PicturePrivate *d; }; } } diff --git a/taglib/mod/modproperties.h b/taglib/mod/modproperties.h index 8bf3ac5e..02a1c606 100644 --- a/taglib/mod/modproperties.h +++ b/taglib/mod/modproperties.h @@ -41,7 +41,6 @@ namespace TagLib { uint instrumentCount() const; uchar lengthInPatterns() const; - protected: void setChannels(int channels); void setInstrumentCount(uint sampleCount); diff --git a/taglib/s3m/s3mproperties.h b/taglib/s3m/s3mproperties.h index 4be14508..0c088668 100644 --- a/taglib/s3m/s3mproperties.h +++ b/taglib/s3m/s3mproperties.h @@ -61,7 +61,6 @@ namespace TagLib { uchar tempo() const; uchar bpmSpeed() const; - protected: void setChannels(int channels); void setLengthInPatterns (ushort lengthInPatterns); diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h index eebafbc5..dda9c83c 100644 --- a/taglib/toolkit/taglib.h +++ b/taglib/toolkit/taglib.h @@ -65,7 +65,7 @@ /*! * This namespace contains everything in TagLib. For projects working with - * TagLib extensively it may be conveniten to add a + * TagLib extensively it may be convenient to add a * \code * using namespace TagLib; * \endcode diff --git a/taglib/xm/xmproperties.h b/taglib/xm/xmproperties.h index 97f93111..1bb89671 100644 --- a/taglib/xm/xmproperties.h +++ b/taglib/xm/xmproperties.h @@ -54,7 +54,6 @@ namespace TagLib { ushort tempo() const; ushort bpmSpeed() const; - protected: void setChannels(int channels); void setLengthInPatterns(ushort lengthInPatterns);