Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable LADSPA plugins on MSVC #6973

Merged
merged 127 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
a84f7df
removed msvc incompaptible plugins list
Rossmaxx Jul 2, 2023
a309439
added Time.h and related changes
Rossmaxx Jul 2, 2023
a7e9798
tweaked some cmake files
Rossmaxx Jul 2, 2023
f066268
removed __attribute__
Rossmaxx Jul 2, 2023
844245d
defined M_PI in caps
Rossmaxx Jul 2, 2023
3411989
minor fix in ladspa cmakelists
Rossmaxx Jul 2, 2023
082773d
added namespace to Times.h
Rossmaxx Jul 2, 2023
5fb6fba
relocated includes
Rossmaxx Jul 2, 2023
8ccb161
fixes to scripted-checks
Rossmaxx Jul 2, 2023
7613a12
deleted unnecessary whitespaces
Rossmaxx Jul 2, 2023
fa02a92
added M_PI to cmt
Rossmaxx Jul 2, 2023
d85c104
Revert "relocated includes"
Rossmaxx Jul 2, 2023
601ee19
removed times.h and the other time files
Rossmaxx Jul 2, 2023
7ad2695
addressing dom's comments 1
Rossmaxx Jul 2, 2023
c252448
addressing dom's concerns 2
Rossmaxx Jul 2, 2023
84edde3
commented sys/time.h
Rossmaxx Jul 2, 2023
7785ebc
another tweak to caps cmakelists
Rossmaxx Jul 3, 2023
dd89d21
added caps init condition
Rossmaxx Jul 3, 2023
1c045ed
attepted fix on calf plugins
Rossmaxx Jul 3, 2023
961334e
fixup to mingw build
Rossmaxx Jul 3, 2023
43ca0f2
added __declspec(dllexport)
Rossmaxx Jul 4, 2023
4a5c64a
added init condition, Will this fix it?
Rossmaxx Jul 4, 2023
b2b8a6e
temporary blacklist for ladspa plugins for testing
Rossmaxx Jul 4, 2023
3c957be
removed cmt from blacklist
Rossmaxx Jul 4, 2023
88dfa0f
added declspec in cmt
Rossmaxx Jul 4, 2023
c77b3a5
removed swh from blacklist
Rossmaxx Jul 5, 2023
dff0cd4
added _USE_MATH_DEFINES to swh
Rossmaxx Jul 6, 2023
9b09fb6
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Jul 6, 2023
87a0103
codefactor fix
Rossmaxx Jul 6, 2023
4570893
added _USE_MATH_DEFINES to pitchscale.h
Rossmaxx Jul 6, 2023
2274147
workaround to enable sinus_wavewrapper
Rossmaxx Jul 6, 2023
2481731
Revert "workaround to enable sinus_wavewrapper"
Rossmaxx Jul 6, 2023
0b431fd
fix to swh
Rossmaxx Jul 7, 2023
06f5ebd
removed the blacklist
Rossmaxx Jul 7, 2023
529a570
added math defines to tap_utils.h
Rossmaxx Jul 7, 2023
301c25f
added math defines to calf primitives.h
Rossmaxx Jul 7, 2023
4bdd52f
added missing endif to calf's primitives.h
Rossmaxx Jul 7, 2023
7478329
added math defines to biquad.h
Rossmaxx Jul 7, 2023
ffe8994
tweak in calf to get it built
Rossmaxx Jul 7, 2023
fad75fd
will it get fixed?
Rossmaxx Jul 7, 2023
0321269
final patch to fix i guess
Rossmaxx Jul 7, 2023
6242930
added declspec to tap
Rossmaxx Jul 8, 2023
c0ad959
added the blacklist back in for calf
Rossmaxx Jul 8, 2023
3637a1f
updated swh to upstream
Rossmaxx Jul 8, 2023
7e9a734
updated cmt to master
Rossmaxx Jul 8, 2023
91f3b77
pulled to cmt to master try 2
Rossmaxx Jul 8, 2023
dd3d3b9
remove blacklist + experimnt removing declspec tap
Rossmaxx Jul 10, 2023
cbebc07
experiment replacing bind2nd with lambdas veal
Rossmaxx Jul 10, 2023
8f52dba
removed functional.h in veal
Rossmaxx Jul 10, 2023
bd657a5
checked out to ladspa branch
Rossmaxx Jul 12, 2023
19e96aa
fixed veal
Rossmaxx Jul 12, 2023
c3e54e1
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Jul 12, 2023
7c6bbd2
attempt fix at mac builds
Rossmaxx Jul 12, 2023
2923971
Revert "attempt fix at mac builds"
Rossmaxx Jul 12, 2023
4cba33a
added list-moreutils to build.yml
Rossmaxx Jul 12, 2023
b4e7715
Attempt to fix MacOS builds
tresf Jul 13, 2023
384aa24
Fix typo
tresf Jul 13, 2023
da019b7
Formatting
tresf Jul 13, 2023
329613b
Formatting (again)
tresf Jul 13, 2023
d6b4f82
addressed dom's pending comment
Rossmaxx Jul 13, 2023
01eaa19
fixed build issues
Rossmaxx Jul 13, 2023
12a1300
CMake perl detection
tresf Jul 16, 2023
91355ae
Don't mandate cmake 3.12 because mingw
tresf Jul 16, 2023
2ac6036
fixed broken unicode symbol in caps/basics.h
Rossmaxx Jul 16, 2023
8812790
got rid of unnecessary __attribute__(s)
Rossmaxx Jul 16, 2023
0e6d02e
updated tap plugins to master
Rossmaxx Jul 16, 2023
249b332
Fix older CMake versions
tresf Jul 16, 2023
e9bb1a2
Update plugins/LadspaEffect/swh/CMakeLists.txt
tresf Jul 22, 2023
5fc18bc
Update plugins/LadspaEffect/caps/CMakeLists.txt
tresf Jul 22, 2023
c24606b
Update CMakeLists.txt
tresf Jul 23, 2023
7d317ea
Merge branch 'master' into enable-ladspa
Rossmaxx Sep 7, 2023
561821f
Merge branch 'master' into enable-ladspa
Rossmaxx Sep 9, 2023
02e0664
disabled compiler flags for msvc
Rossmaxx Sep 9, 2023
a0f7be4
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Sep 16, 2023
cda9fd6
Merge branch 'master' into enable-ladspa
Rossmaxx Sep 21, 2023
65b2d67
removed unnecessary cmake policies
Rossmaxx Sep 24, 2023
b1db760
Merge branch 'enable-ladspa' of https://github.com/Rossmaxx/lmms into…
Rossmaxx Sep 24, 2023
afc9f29
attempt fix at build failure at swh if perl missin
Rossmaxx Sep 24, 2023
0977397
attempt fix at build failure at swh if perl missin
Rossmaxx Sep 24, 2023
0b21893
fixed a small messup while amending commit
Rossmaxx Sep 24, 2023
a325901
attempt removal of basics.h include
Rossmaxx Sep 24, 2023
709fda7
Merge branch 'master' into enable-ladspa
Rossmaxx Sep 28, 2023
fc670dd
whitespace changes
Rossmaxx Sep 28, 2023
5991604
missed this change
Rossmaxx Sep 28, 2023
944d1e7
reverted unnecessary set swh change
Rossmaxx Sep 28, 2023
0ce1b4b
additional whitespace change which missed previous
Rossmaxx Sep 28, 2023
7b367b9
attempt fix at x in basics.h
Rossmaxx Sep 28, 2023
4884e58
used lowercase x instead to fix broken utf char.
Rossmaxx Sep 28, 2023
66d5ed2
Revert "added caps init condition"
Rossmaxx Sep 28, 2023
8deca2c
added caps struct initialisation
Rossmaxx Sep 28, 2023
c347127
comment
Rossmaxx Sep 28, 2023
825eb4e
readded the seed() and formattings
Rossmaxx Sep 28, 2023
8bcc089
fixed seed formatting again
Rossmaxx Sep 28, 2023
9f69a8a
redundant tabspace
Rossmaxx Sep 28, 2023
3d7d852
fixed ambiguous comment in interface.cc
Rossmaxx Sep 30, 2023
90a7490
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Sep 30, 2023
5c55175
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Oct 15, 2023
fdf4676
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Oct 17, 2023
0b6a856
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Oct 30, 2023
c88b09e
Merge branch 'LMMS:master' into enable-ladspa
Rossmaxx Oct 31, 2023
adae408
added stack free macro
Rossmaxx Oct 31, 2023
16c4e54
Merge branch 'master' of https://github.com/LMMS/lmms into enable-ladspa
Rossmaxx Nov 3, 2023
26bbe88
another attempt
Rossmaxx Nov 3, 2023
3d022c1
Merge branch 'fix-veal-leak' into fix-cmt-leak
Rossmaxx Nov 6, 2023
8ffaaff
updated cmt submodule again
Rossmaxx Nov 6, 2023
f83b3b7
removed the cmt fix (to be included again when the pr gets merged)
Rossmaxx Nov 6, 2023
660b513
added missing power sign
Rossmaxx Nov 6, 2023
0dcc512
updated veal submodule properly
Rossmaxx Nov 6, 2023
d15bc86
Merge branch 'LMMS:master' into enable-ladspa-two
Rossmaxx Nov 11, 2023
eedf334
updated submodules to fix crashes
Rossmaxx Nov 11, 2023
f14e42b
Merge branch 'LMMS:master' into enable-ladspa-two
Rossmaxx Dec 4, 2023
a18d848
Update veal submodule
messmerd Dec 4, 2023
5a7ed0b
Merge branch 'LMMS:master' into enable-ladspa-two
Rossmaxx Dec 16, 2023
eb2e603
Merge branch 'LMMS:master' into enable-ladspa-two
Rossmaxx Dec 24, 2023
b82704c
addressed messmerd's comments
Rossmaxx Jan 25, 2024
db2513d
Merge branch 'LMMS:master' into enable-ladspa-two
Rossmaxx Mar 10, 2024
667ccc6
changes to exporting per dom's suggestions
Rossmaxx Mar 10, 2024
4b4650b
attempted fix at basics.h encoding error
Rossmaxx Mar 10, 2024
a5dfda3
whitespace
Rossmaxx Mar 10, 2024
bfe6975
missed caps
Rossmaxx Mar 10, 2024
63c6353
removed rpmalloc
Rossmaxx Mar 10, 2024
e7b2a68
removed the GL flag per dom
Rossmaxx Mar 10, 2024
c4a0ec5
Revert the broken character broken fix
Rossmaxx Mar 10, 2024
bdde548
Merge branch 'master' into enable-ladspa-two
DomClark May 8, 2024
295e87e
Remove MSVC dllexport attributes
DomClark May 10, 2024
ea89079
Fix compiler flags and silence obnoxious warnings
DomClark May 10, 2024
84eb087
Clean up a bit
DomClark May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
ENDIF()
ELSEIF(MSVC)
# Remove any existing /W flags
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
SET(WERROR_FLAGS "/W2")
IF(${USE_WERROR})
Expand Down
9 changes: 0 additions & 9 deletions cmake/modules/PluginList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,3 @@ IF(LIST_PLUGINS)
UNSET(LIST_PLUGINS CACHE)
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()

11 changes: 10 additions & 1 deletion plugins/LadspaEffect/calf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(INLINE_FLAGS -finline-functions-called-once -finline-limit=80)
SET(OTHER_FLAGS -Wno-format-overflow)
ENDIF()
target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS} ${OTHER_FLAGS})

if(MSVC)
target_compile_options(veal PRIVATE /wd4099 /wd4244 /wd4305)
else()
target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS} ${OTHER_FLAGS})
endif()

if(MSVC)
target_link_options(veal PRIVATE "/EXPORT:ladspa_descriptor")
endif()

if(LMMS_BUILD_WIN32)
add_custom_command(
Expand Down
12 changes: 11 additions & 1 deletion plugins/LadspaEffect/caps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ 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(MSVC)
target_compile_options(caps PRIVATE /wd4244 /wd4305)
else()
target_compile_options(caps PRIVATE -O2 -funroll-loops -Wno-write-strings)
endif()

if(MSVC)
target_link_options(caps PRIVATE "/EXPORT:ladspa_descriptor")
endif()

IF(LMMS_BUILD_WIN32)
add_custom_command(
Expand All @@ -18,6 +27,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)
Expand Down
5 changes: 4 additions & 1 deletion plugins/LadspaEffect/caps/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#include <stdlib.h>
#include <string.h>

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <math.h>

#include <assert.h>
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions plugins/LadspaEffect/caps/dsp/Eq.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,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 */
Expand Down
11 changes: 8 additions & 3 deletions plugins/LadspaEffect/caps/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(2541 - 2580 donated to artemio@kdemail.net)
*/

#include <sys/time.h>
// #include <sys/time.h>

#include "basics.h"

Expand Down Expand Up @@ -69,7 +69,6 @@ seed()

extern "C" {

__attribute__ ((constructor))
void caps_so_init()
{
DescriptorStub ** d = descriptors;
Expand Down Expand Up @@ -125,7 +124,6 @@ void caps_so_init()
//seed();
}

__attribute__ ((destructor))
void caps_so_fini()
{
for (ulong i = 0; i < N; ++i)
Expand All @@ -142,4 +140,11 @@ ladspa_descriptor (unsigned long i)
return 0;
}

struct CapsSoInit
{
CapsSoInit() { caps_so_init(); }
~CapsSoInit() { caps_so_fini(); }
};
static CapsSoInit capsSoInit;

}; /* extern "C" */
11 changes: 10 additions & 1 deletion plugins/LadspaEffect/cmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ ADD_LIBRARY(cmt MODULE ${SOURCES})
INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")

SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "")
target_compile_options(cmt PRIVATE -Wall -O3 -fno-strict-aliasing)

if(MSVC)
target_compile_options(cmt PRIVATE /wd4244 /wd4305)
else()
target_compile_options(cmt PRIVATE -Wall -O3 -fno-strict-aliasing)
endif()

if(LMMS_BUILD_WIN32)
add_custom_command(
Expand All @@ -17,6 +22,10 @@ if(LMMS_BUILD_WIN32)
)
endif()

if(MSVC)
target_link_options(cmt PRIVATE "/EXPORT:ladspa_descriptor")
endif()

if(NOT LMMS_BUILD_WIN32)
target_compile_options(cmt PRIVATE -fPIC)
endif()
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/cmt/cmt
Submodule cmt updated 3 files
+1 −4 src/cmt.h
+1 −1 src/delay.cpp
+0 −4 src/init.cpp
14 changes: 11 additions & 3 deletions plugins/LadspaEffect/swh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ ELSE()
ENDIF()

# Additional compile flags
SET(COMPILE_FLAGS "${COMPILE_FLAGS} -O3 -Wall")
SET(COMPILE_FLAGS "${COMPILE_FLAGS} -fomit-frame-pointer -funroll-loops -ffast-math -c -fno-strict-aliasing")
SET(COMPILE_FLAGS "${COMPILE_FLAGS} ${PIC_FLAGS}")
if(MSVC)
set(COMPILE_FLAGS "${COMPILE_FLAGS} /wd4244 /wd4273 /wd4305")
else()
set(COMPILE_FLAGS "${COMPILE_FLAGS} -O3 -Wall")
set(COMPILE_FLAGS "${COMPILE_FLAGS} -fomit-frame-pointer -funroll-loops -ffast-math -c -fno-strict-aliasing")
set(COMPILE_FLAGS "${COMPILE_FLAGS} ${PIC_FLAGS}")
endif()

# Loop over every XML file
FILE(GLOB XML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ladspa/*.xml")
Expand All @@ -34,6 +38,10 @@ FOREACH(_item ${XML_SOURCES})
# Add a library target for this C file, which depends on success of makestup.pl
ADD_LIBRARY("${_plugin}" MODULE "${_out_file}")

if(MSVC)
target_link_options("${_plugin}" PRIVATE "/EXPORT:ladspa_descriptor")
endif()

# Vocoder does not use fftw
IF(NOT ("${_plugin}" STREQUAL "vocoder_1337"))
TARGET_LINK_LIBRARIES("${_plugin}" ${FFTW3F_LIBRARIES})
Expand Down
10 changes: 8 additions & 2 deletions plugins/LadspaEffect/tap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
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")
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /fp:fast")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
endif()
FOREACH(_item ${PLUGIN_SOURCES})
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
ADD_LIBRARY("${_plugin}" MODULE "${_item}")
if(MSVC)
target_link_options("${_plugin}" PRIVATE "/EXPORT:ladspa_descriptor")
endif()
# TAP pinknoise will re-init srand(); use existing seed instead
IF("${_plugin}" MATCHES "tap_pinknoise")
TARGET_COMPILE_DEFINITIONS("${_plugin}" PRIVATE TAP_DISABLE_SRAND=1)
Expand All @@ -24,4 +31,3 @@ FOREACH(_item ${PLUGIN_SOURCES})
TARGET_LINK_LIBRARIES("${_plugin}" m)
ENDIF()
ENDFOREACH()

Loading