diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3ac9e8770..b59d0c59315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,24 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR}) SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +# CMAKE_POLICY Section +IF(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0005 NEW) + CMAKE_POLICY(SET CMP0003 NEW) + IF (CMAKE_MAJOR_VERSION GREATER 2) + CMAKE_POLICY(SET CMP0026 NEW) + CMAKE_POLICY(SET CMP0045 NEW) + CMAKE_POLICY(SET CMP0050 OLD) + ENDIF() + CMAKE_POLICY(SET CMP0020 NEW) + CMAKE_POLICY(SET CMP0057 NEW) + # TODO: Keep CMP0074 but remove this condition when cmake 3.12+ is guaranteed + IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12) + # Needed for the SWH Ladspa plugins. See below. + CMAKE_POLICY(SET CMP0074 NEW) # find_package() uses _ROOT variables + ENDIF() +ENDIF(COMMAND CMAKE_POLICY) + # Import of windows.h breaks min()/max() ADD_DEFINITIONS(-DNOMINMAX) @@ -299,6 +317,11 @@ ELSE(WANT_CMT) ENDIF(WANT_CMT) IF(WANT_SWH) + IF(LMMS_BUILD_APPLE) + # Prefer system perl over Homebrew, MacPorts, etc + SET(Perl_ROOT "/usr/bin") + ENDIF() + FIND_PACKAGE(Perl) IF(PERL_FOUND) SET(LMMS_HAVE_SWH TRUE) SET(STATUS_SWH "OK") diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 00000000000..b888151b27d --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,66 @@ +{ + "configurations": [ + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "variables": [ + { + "name": "Qt5_DIR", + "value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake", + "type": "PATH" + }, + { + "name": "Qt5Test_DIR", + "value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5Test", + "type": "PATH" + }, + { + "name": "PERL_EXECUTABLE", + "value": "C:/Strawberry/perl/bin/perl.exe", + "type": "FILEPATH" + }, + { + "name": "VCPKG_TRACE_FIND_PACKAGE", + "value": "ON", + "type": "STRING" + } + ], + "cmakeToolchain": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + { + "name": "x64-Release", + "generator": "Ninja", + "configurationType": "Release", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeToolchain": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake", + "inheritEnvironments": [ "msvc_x64" ], + "variables": [ + { + "name": "Qt5_DIR", + "value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake", + "type": "PATH" + }, + { + "name": "Qt5Test_DIR", + "value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5Test", + "type": "PATH" + }, + { + "name": "PERL_EXECUTABLE", + "value": "C:/Strawberry/perl/bin/perl.exe", + "type": "FILEPATH" + }, + { + "name": "VCPKG_TRACE_FIND_PACKAGE", + "value": "ON", + "type": "STRING" + } + ] + } + ] +} \ No newline at end of file diff --git a/cmake/modules/PluginList.cmake b/cmake/modules/PluginList.cmake index 0a4686fb2c6..28c960a8e71 100644 --- a/cmake/modules/PluginList.cmake +++ b/cmake/modules/PluginList.cmake @@ -99,11 +99,3 @@ IF(LIST_PLUGINS) LIST_ALL_PLUGINS() ENDIF() -IF(MSVC) - SET(MSVC_INCOMPATIBLE_PLUGINS - LadspaEffect - ) - message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}") - LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS}) -ENDIF() - diff --git a/include/ladspa.h b/include/ladspa.h index 5c30a8a4b5c..8f449562fbb 100644 --- a/include/ladspa.h +++ b/include/ladspa.h @@ -586,6 +586,9 @@ typedef struct _LADSPA_Descriptor { returning NULL, so the plugin count can be determined by checking for the least index that results in NULL being returned. */ +#ifdef _MSC_VER +__declspec(dllexport) +#endif const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index); /* Datatype corresponding to the ladspa_descriptor() function. */ diff --git a/plugins/LadspaEffect/calf/CMakeLists.txt b/plugins/LadspaEffect/calf/CMakeLists.txt index 0c9cd8fa96e..6f7bb8c0110 100644 --- a/plugins/LadspaEffect/calf/CMakeLists.txt +++ b/plugins/LadspaEffect/calf/CMakeLists.txt @@ -38,7 +38,10 @@ SET(INLINE_FLAGS "") IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") SET(INLINE_FLAGS -finline-functions-called-once -finline-limit=80) ENDIF() -target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS}) + +IF(NOT MSVC) + target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS}) +endif() if(LMMS_BUILD_WIN32) add_custom_command( diff --git a/plugins/LadspaEffect/calf/veal b/plugins/LadspaEffect/calf/veal index fe628885b76..aaea579b7c4 160000 --- a/plugins/LadspaEffect/calf/veal +++ b/plugins/LadspaEffect/calf/veal @@ -1 +1 @@ -Subproject commit fe628885b761372b37136a3f2b7c3d56e179e3ba +Subproject commit aaea579b7c403a55f930b82c2f705e46ad989c67 diff --git a/plugins/LadspaEffect/caps/CMakeLists.txt b/plugins/LadspaEffect/caps/CMakeLists.txt index bdcf3a96af4..69480c32c46 100644 --- a/plugins/LadspaEffect/caps/CMakeLists.txt +++ b/plugins/LadspaEffect/caps/CMakeLists.txt @@ -7,7 +7,10 @@ IF(LMMS_BUILD_WIN64) ADD_DEFINITIONS(-DLMMS_BUILD_WIN64) ENDIF(LMMS_BUILD_WIN64) SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "") -SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings") + +IF(NOT MSVC) + SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings") +ENDIF() IF(LMMS_BUILD_WIN32) add_custom_command( @@ -18,6 +21,7 @@ IF(LMMS_BUILD_WIN32) COMMAND_EXPAND_LISTS ) ENDIF(LMMS_BUILD_WIN32) + IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) SET_TARGET_PROPERTIES(caps PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined") ENDIF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) diff --git a/plugins/LadspaEffect/caps/basics.h b/plugins/LadspaEffect/caps/basics.h index df24e8c05ed..840cc743744 100644 --- a/plugins/LadspaEffect/caps/basics.h +++ b/plugins/LadspaEffect/caps/basics.h @@ -38,14 +38,17 @@ #define _ISOC99_SOURCE 1 #define _ISOC9X_SOURCE 1 +#include +#include +#include #include #include +#ifndef _USE_MATH_DEFINES +#define _USE_MATH_DEFINES +#endif #include -#include -#include -#include #include @@ -76,7 +79,7 @@ #define MIN_GAIN .000001 /* -120 dB */ -/* smallest non-denormal 32 bit IEEE float is 1.18×10-38 */ +/* smallest non-denormal 32 bit IEEE float is 1.18*10^-38 */ #define NOISE_FLOOR .00000000000005 /* -266 dB */ typedef int8_t int8; diff --git a/plugins/LadspaEffect/caps/dsp/Eq.h b/plugins/LadspaEffect/caps/dsp/Eq.h index 92639e8a185..1f3ed5eef84 100644 --- a/plugins/LadspaEffect/caps/dsp/Eq.h +++ b/plugins/LadspaEffect/caps/dsp/Eq.h @@ -26,6 +26,9 @@ 02111-1307, USA or point your web browser to http://www.gnu.org. */ + +#include "../basics.h" + #ifndef _DSP_EQ_H_ #define _DSP_EQ_H_ @@ -62,11 +65,11 @@ class Eq { public: /* recursion coefficients, 3 per band */ - eq_sample __attribute__ ((aligned)) a[Bands], b[Bands], c[Bands]; + eq_sample a[Bands], b[Bands], c[Bands]; /* past outputs, 2 per band */ - eq_sample __attribute__ ((aligned)) y[2][Bands]; + eq_sample y[2][Bands]; /* current gain and recursion factor, each 1 per band = 2 */ - eq_sample __attribute__ ((aligned)) gain[Bands], gf[Bands]; + eq_sample gain[Bands], gf[Bands]; /* input history */ eq_sample x[2]; /* history index */ diff --git a/plugins/LadspaEffect/caps/dsp/OnePole.h b/plugins/LadspaEffect/caps/dsp/OnePole.h index 9a317805321..a53ec9fc8f9 100644 --- a/plugins/LadspaEffect/caps/dsp/OnePole.h +++ b/plugins/LadspaEffect/caps/dsp/OnePole.h @@ -25,6 +25,8 @@ 02111-1307, USA or point your web browser to http://www.gnu.org. */ +#include "../basics.h" + #ifndef _ONE_POLE_H_ #define _ONE_POLE_H_ diff --git a/plugins/LadspaEffect/caps/dsp/SVF.h b/plugins/LadspaEffect/caps/dsp/SVF.h index ccd5734ab3f..fe49643a93b 100644 --- a/plugins/LadspaEffect/caps/dsp/SVF.h +++ b/plugins/LadspaEffect/caps/dsp/SVF.h @@ -70,9 +70,12 @@ } */ +#include "../basics.h" + #ifndef _DSP_SVF_H_ #define _DSP_SVF_H_ + namespace DSP { template diff --git a/plugins/LadspaEffect/caps/dsp/Sine.h b/plugins/LadspaEffect/caps/dsp/Sine.h index 43e5f06e03c..47477334e99 100644 --- a/plugins/LadspaEffect/caps/dsp/Sine.h +++ b/plugins/LadspaEffect/caps/dsp/Sine.h @@ -25,6 +25,8 @@ 02111-1307, USA or point your web browser to http://www.gnu.org. */ +#include "../basics.h" + #ifndef _DSP_SINE_H_ #define _DSP_SINE_H_ diff --git a/plugins/LadspaEffect/caps/interface.cc b/plugins/LadspaEffect/caps/interface.cc index 96e3d9806f6..aff95f255c0 100644 --- a/plugins/LadspaEffect/caps/interface.cc +++ b/plugins/LadspaEffect/caps/interface.cc @@ -29,8 +29,6 @@ (2541 - 2580 donated to artemio@kdemail.net) */ -#include - #include "basics.h" #include "Cabinet.h" @@ -58,18 +56,8 @@ #define N 39 static DescriptorStub * descriptors [N]; -/*static inline void -seed() -{ - static struct timeval tv; - gettimeofday (&tv, 0); - - srand (tv.tv_sec ^ tv.tv_usec); -}*/ - extern "C" { -__attribute__ ((constructor)) void caps_so_init() { DescriptorStub ** d = descriptors; @@ -121,11 +109,8 @@ void caps_so_init() /* make sure N is correct */ assert (d - descriptors == N); - - //seed(); } -__attribute__ ((destructor)) void caps_so_fini() { for (ulong i = 0; i < N; ++i) @@ -134,6 +119,9 @@ void caps_so_fini() /* /////////////////////////////////////////////////////////////////////// */ +#ifdef _MSC_VER +__declspec(dllexport) +#endif const LADSPA_Descriptor * ladspa_descriptor (unsigned long i) { @@ -142,4 +130,10 @@ ladspa_descriptor (unsigned long i) return 0; } +struct CapsSoInit { + CapsSoInit() { caps_so_init(); } + ~CapsSoInit() { caps_so_fini(); } +}; +static CapsSoInit capsSoInit; + }; /* extern "C" */ diff --git a/plugins/LadspaEffect/tap/CMakeLists.txt b/plugins/LadspaEffect/tap/CMakeLists.txt index c8d0a4eb833..1afa76153ef 100644 --- a/plugins/LadspaEffect/tap/CMakeLists.txt +++ b/plugins/LadspaEffect/tap/CMakeLists.txt @@ -1,7 +1,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include") FILE(GLOB PLUGIN_SOURCES tap-plugins/*.c) LIST(SORT PLUGIN_SOURCES) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math") FOREACH(_item ${PLUGIN_SOURCES}) GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE) ADD_LIBRARY("${_plugin}" MODULE "${_item}") diff --git a/plugins/OpulenZ/adplug b/plugins/OpulenZ/adplug index 3ed6617ec00..10355fbedb3 160000 --- a/plugins/OpulenZ/adplug +++ b/plugins/OpulenZ/adplug @@ -1 +1 @@ -Subproject commit 3ed6617ec00022dfab574c27710d9071a6032c87 +Subproject commit 10355fbedb3c4d10a67deb5f4214b3f678170ef8 diff --git a/src/3rdparty/mingw-std-threads b/src/3rdparty/mingw-std-threads index 6c2061b7da4..10665829daa 160000 --- a/src/3rdparty/mingw-std-threads +++ b/src/3rdparty/mingw-std-threads @@ -1 +1 @@ -Subproject commit 6c2061b7da41d6aa1b2162ff4383ec3ece864bc6 +Subproject commit 10665829daaedc28629e5e9b014fe498c20d73f2