mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Fixes for mingw32 cross-compiling
This commit is contained in:
parent
08778f3f2c
commit
72aa271b23
@ -65,7 +65,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
|
||||
|
||||
Qt::HANDLE mutex;
|
||||
if (doCreate) {
|
||||
QT_WA( { mutex = CreateMutexW(NULL, FALSE, (TCHAR*)mname.utf16()); },
|
||||
QT_WA( { mutex = CreateMutexW(NULL, FALSE, (WCHAR*)mname.utf16()); },
|
||||
{ mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } );
|
||||
if (!mutex) {
|
||||
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
|
||||
@ -73,7 +73,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
|
||||
}
|
||||
}
|
||||
else {
|
||||
QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (TCHAR*)mname.utf16()); },
|
||||
QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (WCHAR*)mname.utf16()); },
|
||||
{ mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } );
|
||||
if (!mutex) {
|
||||
if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
||||
|
@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
if (CMAKE_FIND_ROOT_PATH)
|
||||
# Help find the Qt headers if we're cross compiling (since we can't run qmake.exe)
|
||||
# CMAKE_FIND_ROOT_PATH should get set by your cmake toolchain file
|
||||
set(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include)
|
||||
set(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib)
|
||||
set(QT_PHONON_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/phonon)
|
||||
endif (CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
find_package(Qt4 REQUIRED)
|
||||
set(QT_USE_QTOPENGL 1)
|
||||
set(QT_USE_QTSQL 1)
|
||||
@ -14,9 +22,13 @@ endif(WIN32)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(Boost REQUIRED)
|
||||
|
||||
pkg_check_modules(TAGLIB taglib)
|
||||
pkg_check_modules(XINE libxine)
|
||||
pkg_check_modules(LIBNOTIFY libnotify)
|
||||
if(WIN32)
|
||||
find_library(TAGLIB_LIBRARIES tag)
|
||||
else(WIN32)
|
||||
pkg_check_modules(TAGLIB taglib)
|
||||
pkg_check_modules(XINE libxine)
|
||||
pkg_check_modules(LIBNOTIFY libnotify)
|
||||
endif(WIN32)
|
||||
|
||||
if (NOT Boost_FOUND)
|
||||
message(FATAL_ERROR "Boost not found")
|
||||
@ -52,6 +64,10 @@ include_directories(${TAGLIB_INCLUDE_DIRS})
|
||||
include_directories(${XINE_INCLUDE_DIRS})
|
||||
include_directories(${LASTFM_INCLUDE_DIRS})
|
||||
|
||||
# Remove GLU and GL from the link line - they're not really required
|
||||
# and don't exist on my mingw toolchain
|
||||
list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
|
||||
|
||||
# Subdirectories
|
||||
add_subdirectory(3rdparty/qtsingleapplication)
|
||||
add_subdirectory(3rdparty/qxt)
|
||||
|
@ -148,19 +148,24 @@ foreach(QM-FILE ${CLEMENTINE-QM-FILES})
|
||||
endforeach(QM-FILE)
|
||||
file(APPEND ${CLEMENTINE-QM-RESOURCE} "</qresource></RCC>")
|
||||
|
||||
|
||||
# Audio engine - phonon on windows, xine elsewhere
|
||||
if(WIN32)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} phononengine.cpp osd_win.cpp)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} phononengine.cpp)
|
||||
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} phononengine.h)
|
||||
else(WIN32)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} xine-engine.cpp xine-scope.c)
|
||||
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} xine-engine.h)
|
||||
endif(WIN32)
|
||||
|
||||
# OSD
|
||||
if(APPLE)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm)
|
||||
else(APPLE)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_x11.cpp)
|
||||
if(WIN32)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_win.cpp)
|
||||
else(WIN32)
|
||||
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_x11.cpp)
|
||||
endif(WIN32)
|
||||
endif(APPLE)
|
||||
|
||||
qt4_wrap_cpp(CLEMENTINE-SOURCES-MOC ${CLEMENTINE-MOC-HEADERS})
|
||||
@ -182,13 +187,13 @@ add_library(clementine_lib
|
||||
${CLEMENTINE-QM-FILES}
|
||||
)
|
||||
target_link_libraries(clementine_lib
|
||||
${QT_LIBRARIES}
|
||||
qtsingleapplication
|
||||
qxt
|
||||
lastfm
|
||||
${XINE_LIBRARIES}
|
||||
${LIBNOTIFY_LIBRARIES}
|
||||
${TAGLIB_LIBRARIES}
|
||||
lastfm
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
if (APPLE)
|
||||
target_link_libraries(clementine_lib
|
||||
|
@ -40,7 +40,7 @@ macro(add_test_file test_source)
|
||||
add_executable(${TEST_NAME}
|
||||
${ARGV0}
|
||||
../3rdparty/gmock/src/gmock_main.cc)
|
||||
target_link_libraries(${TEST_NAME} clementine_lib gmock)
|
||||
target_link_libraries(${TEST_NAME} gmock clementine_lib)
|
||||
add_custom_command(TARGET test POST_BUILD
|
||||
COMMAND ./${TEST_NAME})
|
||||
add_dependencies(test ${TEST_NAME})
|
||||
|
@ -44,7 +44,7 @@ TEST_F(M3UParserTest, ParsesTrackLocationHttp) {
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
TEST_F(M3UParserTest, ParsesTrackLocationHttp) {
|
||||
TEST_F(M3UParserTest, ParsesTrackLocationAbsoluteWindows) {
|
||||
QString line("c:/foo/bar.mp3");
|
||||
QUrl url;
|
||||
ASSERT_TRUE(parser_.ParseTrackLocation(line, &url));
|
||||
|
Loading…
x
Reference in New Issue
Block a user