Skip to content

Commit

Permalink
Build on msvc (#5)
Browse files Browse the repository at this point in the history
* removed msvc incompaptible plugins list

* added Time.h and related changes

* tweaked some cmake files

* removed __attribute__

* defined M_PI in caps

* minor fix in ladspa cmakelists

* added namespace to Times.h

* relocated includes

* fixes to scripted-checks

* deleted unnecessary whitespaces

* added M_PI to cmt

* Revert "relocated includes"

This reverts commit 5fb6fba.

* removed times.h and the other time files

* addressing dom's comments 1

* addressing dom's concerns 2

* commented sys/time.h

* another tweak to caps cmakelists

* added caps init condition

* attepted fix on calf plugins

* fixup to mingw build

* added __declspec(dllexport)

* added init condition, Will this fix it?

* temporary blacklist for ladspa plugins for testing

* removed cmt from blacklist

* added declspec in cmt

* removed swh from blacklist

* added _USE_MATH_DEFINES to swh

* codefactor fix

* added _USE_MATH_DEFINES to pitchscale.h

* workaround to enable sinus_wavewrapper

* Revert "workaround to enable sinus_wavewrapper"

This reverts commit 2274147.

* fix to swh

* removed the blacklist

* added math defines to tap_utils.h

* added math defines to calf primitives.h

* added missing endif to calf's primitives.h

* added math defines to biquad.h

* tweak in calf to get it built

* will it get fixed?

* final patch to fix i guess

* added declspec to tap

* added the blacklist back in for calf

* updated swh to upstream

* updated cmt to master

* pulled to cmt to master try 2

* remove blacklist + experimnt removing declspec tap

* experiment replacing bind2nd with lambdas veal

* removed functional.h in veal

* checked out to ladspa branch

* fixed veal

* attempt fix at mac builds

* Revert "attempt fix at mac builds"

This reverts commit 7c6bbd2.

* added list-moreutils to build.yml

* Attempt to fix MacOS builds

* Fix typo

* Formatting

* Formatting (again)

* addressed dom's pending comment

* fixed build issues

* CMake perl detection

* Don't mandate cmake 3.12 because mingw

* fixed broken unicode symbol in caps/basics.h

* got rid of unnecessary __attribute__(s)

* updated tap plugins to master

* Fix older CMake versions

* .gitignore

* undo gitignore

* Update plugins/LadspaEffect/swh/CMakeLists.txt

Co-authored-by: Dominic Clark <[email protected]>

* Update plugins/LadspaEffect/caps/CMakeLists.txt

Co-authored-by: Dominic Clark <[email protected]>

* Update CMakeLists.txt

Co-authored-by: Dominic Clark <[email protected]>

* add cmakesettings

* fix slashes

* add test

* add more cmakesettings

* add samplerate

* add samplerate include dir

* Update adplug

* add cmakeToolchain

* remove unused vars

* Update adplug

* remove vcpkg var

* VCPKG_TRACE_FIND_PACKAGE=ON

* add test var back in

* add strawberry perl

* add cmake prefix path

* update vcpkg_trace

* use msvc_x64

* newline

* add release settings

* Update mingw-std-threads

* Update adplug

---------

Co-authored-by: Ross maxx <[email protected]>
Co-authored-by: Rossmaxx <[email protected]>
Co-authored-by: Tres Finocchiaro <[email protected]>
Co-authored-by: Dominic Clark <[email protected]>
  • Loading branch information
5 people authored Sep 24, 2023
1 parent 33d1bad commit d5f90b5
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 38 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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")
Expand Down
66 changes: 66 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
8 changes: 0 additions & 8 deletions cmake/modules/PluginList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

3 changes: 3 additions & 0 deletions include/ladspa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 4 additions & 1 deletion plugins/LadspaEffect/calf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/calf/veal
Submodule veal updated 52 files
+4 −0 ChangeLog
+66 −15 calf-gui.xml
+2 −2 configure.ac
+18 −1 doc/manuals/Limiter.html
+6 −1 doc/manuals/Multiband Limiter.html
+5 −0 doc/manuals/Sidechain Limiter.html
+ doc/manuals/images/Calf - Limiters - ASC behaviours.jpg
+ doc/manuals/images/Calf - Limiters - ASC.jpg
+1 −1 gui/gui/eq30.xml
+17 −16 gui/gui/limiter.xml
+15 −12 gui/gui/multibandlimiter.xml
+12 −9 gui/gui/sidechainlimiter.xml
+58 −48 src/analyzer.cpp
+37 −21 src/audio_fx.cpp
+1 −0 src/calf/audio_fx.h
+4 −0 src/calf/biquad.h
+4 −4 src/calf/fixed_point.h
+2 −2 src/calf/giface.h
+2 −0 src/calf/gui.h
+2 −0 src/calf/gui_config.h
+2 −0 src/calf/host_session.h
+2 −2 src/calf/jackhost.h
+5 −0 src/calf/loudness.h
+1 −1 src/calf/lv2_options.h
+1 −1 src/calf/lv2_ui.h
+3 −3 src/calf/lv2wrap.h
+3 −0 src/calf/metadata.h
+9 −9 src/calf/modules_filter.h
+1,373 −1,089 src/calf/orfanidis_eq.h
+7 −3 src/calf/osctl.h
+6 −0 src/calf/primitives.h
+14 −3 src/calf/utils.h
+1 −4 src/ctl_knob.cpp
+0 −3 src/ctl_tube.cpp
+25 −0 src/fluidsynth.cpp
+9 −3 src/giface.cpp
+92 −67 src/gtk_main_win.cpp
+16 −10 src/gui_config.cpp
+37 −18 src/host_session.cpp
+21 −6 src/jackhost.cpp
+1 −1 src/makerdf.cpp
+6 −2 src/metadata.cpp
+72 −72 src/modules_comp.cpp
+4 −3 src/modules_delay.cpp
+38 −12 src/modules_dist.cpp
+82 −75 src/modules_filter.cpp
+26 −17 src/modules_limit.cpp
+26 −26 src/modules_mod.cpp
+10 −9 src/modules_tools.cpp
+2 −1 src/organ.cpp
+26 −1 src/utils.cpp
+0 −1 src/veal.cpp
6 changes: 5 additions & 1 deletion plugins/LadspaEffect/caps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions plugins/LadspaEffect/caps/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@
#define _ISOC99_SOURCE 1
#define _ISOC9X_SOURCE 1

#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

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

#include <assert.h>
#include <stdio.h>
#include <stdint.h>

#include <ladspa.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
9 changes: 6 additions & 3 deletions plugins/LadspaEffect/caps/dsp/Eq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/OnePole.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
3 changes: 3 additions & 0 deletions plugins/LadspaEffect/caps/dsp/SVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
}
*/

#include "../basics.h"

#ifndef _DSP_SVF_H_
#define _DSP_SVF_H_


namespace DSP {

template <int OVERSAMPLE>
Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/Sine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
24 changes: 9 additions & 15 deletions plugins/LadspaEffect/caps/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
(2541 - 2580 donated to [email protected])
*/

#include <sys/time.h>

#include "basics.h"

#include "Cabinet.h"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -134,6 +119,9 @@ void caps_so_fini()

/* /////////////////////////////////////////////////////////////////////// */

#ifdef _MSC_VER
__declspec(dllexport)
#endif
const LADSPA_Descriptor *
ladspa_descriptor (unsigned long i)
{
Expand All @@ -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" */
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/swh/ladspa
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/tap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/tap/tap-plugins
2 changes: 1 addition & 1 deletion plugins/OpulenZ/adplug
Submodule adplug updated 721 files

0 comments on commit d5f90b5

Please sign in to comment.