MSVC: Various fixes
* CMake * Compiler flags fixes * Don't strip * Fix default template argument errors * Fix VLAs. MSVC doesn't support C99, so Variable-Length-Arrays are not available. Use QVarLengthArray instead.
This commit is contained in:
@@ -489,7 +489,9 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES (GNU|AppleClang))
|
||||
IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32))
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
ELSEIF(MSVC)
|
||||
# Remove any existing /W flags
|
||||
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
SET(WERROR_FLAGS "/W2")
|
||||
IF(${USE_WERROR})
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} /WX")
|
||||
|
||||
@@ -74,10 +74,10 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-bundle_loader ${CMAKE_BINARY_DIR}/lmms")
|
||||
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
|
||||
ENDIF(LMMS_BUILD_APPLE)
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
IF(LMMS_BUILD_WIN32 AND STRIP)
|
||||
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} $<TARGET_FILE:${PLUGIN_NAME}>)
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
ENDIF()
|
||||
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${RCC_OUT} ${plugin_MOC_out}")
|
||||
ENDMACRO(BUILD_PLUGIN)
|
||||
|
||||
@@ -96,7 +96,7 @@ struct typeInfo
|
||||
template<>
|
||||
inline float typeInfo<float>::minEps()
|
||||
{
|
||||
return 1.0e-10;
|
||||
return 1.0e-10f;
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
@@ -40,7 +40,7 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
|
||||
m_enabled1Model( true, this, tr( "Filter 1 enabled" ) ),
|
||||
m_filter1Model( this, tr( "Filter 1 type" ) ),
|
||||
m_cut1Model( 7000.0f, 1.0f, 20000.0f, 1.0f, this, tr( "Cutoff 1 frequency" ) ),
|
||||
m_res1Model( 0.5, BasicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 1" ) ),
|
||||
m_res1Model( 0.5, BasicFilters<>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 1" ) ),
|
||||
m_gain1Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 1" ) ),
|
||||
|
||||
m_mixModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Mix" ) ),
|
||||
@@ -48,7 +48,7 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
|
||||
m_enabled2Model( true, this, tr( "Filter 2 enabled" ) ),
|
||||
m_filter2Model( this, tr( "Filter 2 type" ) ),
|
||||
m_cut2Model( 7000.0f, 1.0f, 20000.0f, 1.0f, this, tr( "Cutoff 2 frequency" ) ),
|
||||
m_res2Model( 0.5, BasicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 2" ) ),
|
||||
m_res2Model( 0.5, BasicFilters<>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 2" ) ),
|
||||
m_gain2Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 2" ) )
|
||||
{
|
||||
m_filter1Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <QtCore/QVarLengthArray>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "LadspaEffect.h"
|
||||
@@ -141,12 +142,12 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
int frames = _frames;
|
||||
sampleFrame * o_buf = NULL;
|
||||
sampleFrame sBuf [_frames];
|
||||
QVarLengthArray<sample_t> sBuf(_frames * DEFAULT_CHANNELS);
|
||||
|
||||
if( m_maxSampleRate < Engine::mixer()->processingSampleRate() )
|
||||
{
|
||||
o_buf = _buf;
|
||||
_buf = &sBuf[0];
|
||||
_buf = reinterpret_cast<sampleFrame*>(sBuf.data());
|
||||
sampleDown( o_buf, _buf, m_maxSampleRate );
|
||||
frames = _frames * m_maxSampleRate /
|
||||
Engine::mixer()->processingSampleRate();
|
||||
|
||||
@@ -102,7 +102,7 @@ void MultitapEchoControls::setDefaultAmpShape()
|
||||
{
|
||||
const int length = m_steps.value();
|
||||
|
||||
float samples [length];
|
||||
QVarLengthArray<float> samples(length);
|
||||
for( int i = 0; i < length; ++i )
|
||||
{
|
||||
samples[i] = 0.0f;
|
||||
@@ -116,7 +116,7 @@ void MultitapEchoControls::setDefaultLpShape()
|
||||
{
|
||||
const int length = m_steps.value();
|
||||
|
||||
float samples [length];
|
||||
QVarLengthArray<float> samples(length);
|
||||
for( int i = 0; i < length; ++i )
|
||||
{
|
||||
samples[i] = 3.0f;
|
||||
|
||||
@@ -2,7 +2,7 @@ INCLUDE(BuildPlugin)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_sc_andor -Dexprtk_disable_return_statement -Dexprtk_disable_break_continue -Dexprtk_disable_comments -Dexprtk_disable_string_capabilities -Dexprtk_disable_rtl_io_file -Dexprtk_disable_rtl_vecops ${WERROR_FLAGS} -fexceptions")
|
||||
|
||||
IF(WIN32)
|
||||
IF(WIN32 AND NOT MSVC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ ENDIF()
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LMMS_RCC_OUT} ${LMMS_UI_OUT} lmmsconfig.h lmms.1.gz")
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(EXTRA_LIBRARIES "-lwinmm")
|
||||
SET(EXTRA_LIBRARIES "winmm")
|
||||
ENDIF()
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
|
||||
Reference in New Issue
Block a user