1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 08:34:34 +02:00

Merge pull request #324 from TheOneRing/fix_logger_default_mingw

Fix build of Logger.cpp with an unpatched version of gcc on Windows.
This commit is contained in:
Dominik Schmidt
2015-09-04 15:45:00 +02:00
10 changed files with 27 additions and 22 deletions

View File

@@ -6,9 +6,16 @@ add_definitions( -DDLLEXPORT_PRO )
add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS ) add_definitions( -DQT_SHAREDPOINTER_TRACK_POINTERS )
add_definitions( -DPORTFWDDLLEXPORT_STATIC ) add_definitions( -DPORTFWDDLLEXPORT_STATIC )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../tomahawk/Config.h.in IF( WIN32 )
INCLUDE( "CMakeLists.win32.cmake" )
ENDIF( WIN32 )
IF( UNIX )
INCLUDE( "CMakeLists.unix.cmake" )
ENDIF( UNIX )
configure_file(Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h) ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../tomahawk/TomahawkVersion.h.in configure_file(TomahawkVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/TomahawkVersion.h) ${CMAKE_CURRENT_BINARY_DIR}/TomahawkVersion.h)
set( libGuiSources set( libGuiSources

View File

@@ -1,5 +1,5 @@
ADD_DEFINITIONS( /DNOMINMAX ) ADD_DEFINITIONS( -DNOMINMAX )
ADD_DEFINITIONS( /DWIN32_LEAN_AND_MEAN ) ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
ADD_DEFINITIONS( -static-libgcc ) ADD_DEFINITIONS( -static-libgcc )
ADD_DEFINITIONS( -DUNICODE ) ADD_DEFINITIONS( -DUNICODE )
@@ -21,3 +21,13 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
if(QTSPARKLE_FOUND) if(QTSPARKLE_FOUND)
list(APPEND OS_SPECIFIC_LINK_LIBRARIES ${QTSPARKLE_LIBRARIES}) list(APPEND OS_SPECIFIC_LINK_LIBRARIES ${QTSPARKLE_LIBRARIES})
endif() endif()
include(CheckCXXSourceCompiles)
check_cxx_source_compiles( "#include <fstream>
int main(){
std::ofstream stream(L\"Test\");
return 0;
}"
OFSTREAM_CAN_OPEN_WCHAR_FILE_NAMES)

View File

@@ -15,16 +15,18 @@
#cmakedefine WITH_CRASHREPORTER #cmakedefine WITH_CRASHREPORTER
#cmakedefine WITH_BINARY_ATTICA #cmakedefine WITH_BINARY_ATTICA
#cmakedefine WITH_QtSparkle
#cmakedefine WITH_UPOWER #cmakedefine WITH_UPOWER
#cmakedefine WITH_GNOMESHORTCUTHANDLER #cmakedefine WITH_GNOMESHORTCUTHANDLER
#cmakedefine LIBLASTFM_FOUND #cmakedefine LIBLASTFM_FOUND
#cmakedefine QCA2_FOUND #cmakedefine QCA2_FOUND
#cmakedefine QTSPARKLE_FOUND
#cmakedefine TOMAHAWK_FINEGRAINED_MESSAGES #cmakedefine TOMAHAWK_FINEGRAINED_MESSAGES
#cmakedefine COMPLEX_TAGLIB_FILENAME #cmakedefine COMPLEX_TAGLIB_FILENAME
#cmakedefine HAVE_VLC_ALBUMARTIST #cmakedefine HAVE_VLC_ALBUMARTIST
#cmakedefine HAVE_X11 #cmakedefine HAVE_X11
#cmakedefine OFSTREAM_CAN_OPEN_WCHAR_FILE_NAMES
#endif // CONFIG_H_IN #endif // CONFIG_H_IN

View File

@@ -188,10 +188,9 @@ setupLogfile( QFile& f )
} }
} }
#ifdef _WIN32 #ifdef OFSTREAM_CAN_OPEN_WCHAR_FILE_NAMES
// this is not supported in upstream libstdc++ as shipped with GCC // this is not supported in upstream libstdc++ as shipped with GCC
// GCC needs the patch from https://gcc.gnu.org/ml/libstdc++/2011-06/msg00066.html applied // GCC needs the patch from https://gcc.gnu.org/ml/libstdc++/2011-06/msg00066.html applied
// we could create a CMake check like the one for taglib, but I don't care right now :P
logStream.open( f.fileName().toStdWString().c_str() ); logStream.open( f.fileName().toStdWString().c_str() );
#else #else
logStream.open( f.fileName().toStdString().c_str() ); logStream.open( f.fileName().toStdString().c_str() );

View File

@@ -109,13 +109,6 @@ INCLUDE_DIRECTORIES(
SET( OS_SPECIFIC_LINK_LIBRARIES "" ) SET( OS_SPECIFIC_LINK_LIBRARIES "" )
IF( WIN32 )
INCLUDE( "CMakeLists.win32.cmake" )
ENDIF( WIN32 )
IF( UNIX )
INCLUDE( "CMakeLists.unix.cmake" )
ENDIF( UNIX )
IF( APPLE ) IF( APPLE )
SET( CMAKE_LINKER_FLAGS "-headerpad_max_install_names ${CMAKE_LINKER_FLAGS}" ) SET( CMAKE_LINKER_FLAGS "-headerpad_max_install_names ${CMAKE_LINKER_FLAGS}" )
@@ -130,12 +123,6 @@ ENDIF( QCA2_FOUND )
INCLUDE(GNUInstallDirs) INCLUDE(GNUInstallDirs)
# currently only in libtomahawk, we might want to properly split what's in which config file
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.h.in
# ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TomahawkVersion.h.in
# ${CMAKE_CURRENT_BINARY_DIR}/TomahawkVersion.h)
# translations # translations
include( ${CMAKE_SOURCE_DIR}/lang/translations.cmake ) include( ${CMAKE_SOURCE_DIR}/lang/translations.cmake )
add_tomahawk_translations( ${TOMAHAWK_TRANSLATION_LANGUAGES} ) add_tomahawk_translations( ${TOMAHAWK_TRANSLATION_LANGUAGES} )

View File

@@ -88,7 +88,7 @@
#include "config.h" #include "config.h"
#if defined( Q_OS_WIN ) #if defined( Q_OS_WIN )
#if defined ( WITH_QtSparkle ) #if defined ( QTSPARKLE_FOUND )
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include <qtsparkle/Updater> #include <qtsparkle/Updater>
#else #else
@@ -521,7 +521,7 @@ TomahawkWindow::setupUpdateCheck()
#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE ) #if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )
connect( ActionCollection::instance()->getAction( "checkForUpdates" ), SIGNAL( triggered( bool ) ), connect( ActionCollection::instance()->getAction( "checkForUpdates" ), SIGNAL( triggered( bool ) ),
SLOT( checkForUpdates() ) ); SLOT( checkForUpdates() ) );
#elif defined( Q_OS_WIN ) && defined( WITH_QtSparkle ) #elif defined( Q_OS_WIN ) && defined( QTSPARKLE_FOUND )
QUrl updaterUrl; QUrl updaterUrl;
if ( qApp->arguments().contains( "--debug" ) ) if ( qApp->arguments().contains( "--debug" ) )