From b83006be6e67ef2985439b81d26b5805ba828836 Mon Sep 17 00:00:00 2001 From: tresf Date: Sun, 20 Sep 2015 23:39:58 -0400 Subject: [PATCH] @curlymorphic suggestions :) --- CMakeLists.txt | 9 +++++++++ cmake/modules/BuildPlugin.cmake | 4 ++++ cmake/modules/MinGWCrossCompile.cmake | 21 +++++++++++---------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aae9ad075f2..544bfc1681e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,15 @@ ELSE(LMMS_BUILD_WIN32) ENDIF(LMMS_BUILD_WIN32) +# TODO: Fix linking issues with msys debug builds +IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") + SET(WANT_GIG OFF) + SET(WANT_STK OFF) + SET(WANT_SWH OFF) + SET(STATUS_GIG "not built as requested") + SET(STATUS_STK "not built as requested") +ENDIF() + CHECK_INCLUDE_FILES(stdint.h LMMS_HAVE_STDINT_H) CHECK_INCLUDE_FILES(stdlib.h LMMS_HAVE_STDLIB_H) diff --git a/cmake/modules/BuildPlugin.cmake b/cmake/modules/BuildPlugin.cmake index 438eebb90e3..05f1f77ce90 100644 --- a/cmake/modules/BuildPlugin.cmake +++ b/cmake/modules/BuildPlugin.cmake @@ -40,6 +40,10 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME) LINK_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}) LINK_LIBRARIES(${QT_LIBRARIES}) ENDIF(LMMS_BUILD_WIN32) + IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") + # Override Qt debug libraries with release versions + SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}") + ENDIF() ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out}) IF(QT5) diff --git a/cmake/modules/MinGWCrossCompile.cmake b/cmake/modules/MinGWCrossCompile.cmake index be7508fedeb..606b33092ff 100644 --- a/cmake/modules/MinGWCrossCompile.cmake +++ b/cmake/modules/MinGWCrossCompile.cmake @@ -25,17 +25,18 @@ IF(LMMS_BUILD_MSYS) SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF) SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF) - # FIXME: There should be a cleaner way to do this - # Allows "Debug" msys builds to link against Qt "Release" libraries + # Variable to assist override Qt debug libraries with release versions + SET(QT_OVERRIDE_LIBRARIES + optimized;${MINGW_PREFIX}/bin/QtGui4.dll; + optimized;${MINGW_PREFIX}/bin/QtCore4.dll; + optimized;${MINGW_PREFIX}/bin/QtXml4.dll; + debug;${MINGW_PREFIX}/bin/QtGui4.dll; + debug;${MINGW_PREFIX}/bin/QtCore4.dll; + debug;${MINGW_PREFIX}/bin/QtXml4.dll; + ) IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") - SET(QT_LIBRARIES - optimized;${MINGW_PREFIX}/bin/QtGui4.dll; - optimized;${MINGW_PREFIX}/bin/QtCore4.dll; - optimized;${MINGW_PREFIX}/bin/QtXml4.dll; - debug;${MINGW_PREFIX}/bin/QtGui4.dll; - debug;${MINGW_PREFIX}/bin/QtCore4.dll; - debug;${MINGW_PREFIX}/bin/QtXml4.dll; - ) + # Override Qt debug libraries with release versions + SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}") ENDIF() # Linux mingw requires explicitly defined tools to prevent clash with native system tools ELSE()