Enable LADSPA plugins on MSVC (#6973)
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com> Co-authored-by: Dominic Clark <mrdomclark@gmail.com> Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
@@ -645,6 +645,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})
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
@@ -76,7 +79,7 @@
|
||||
|
||||
#define MIN_GAIN .000001 /* -120 dB */
|
||||
|
||||
/* smallest non-denormal 32 bit IEEE float is 1.18<EFBFBD>10-38 */
|
||||
/* smallest non-denormal 32 bit IEEE float is 1.18×10^-38 */
|
||||
#define NOISE_FLOOR .00000000000005 /* -266 dB */
|
||||
|
||||
typedef int8_t int8;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
(2541 - 2580 donated to artemio@kdemail.net)
|
||||
*/
|
||||
|
||||
#include <sys/time.h>
|
||||
// #include <sys/time.h>
|
||||
|
||||
#include "basics.h"
|
||||
|
||||
@@ -69,7 +69,6 @@ seed()
|
||||
|
||||
extern "C" {
|
||||
|
||||
__attribute__ ((constructor))
|
||||
void caps_so_init()
|
||||
{
|
||||
DescriptorStub ** d = descriptors;
|
||||
@@ -125,7 +124,6 @@ void caps_so_init()
|
||||
//seed();
|
||||
}
|
||||
|
||||
__attribute__ ((destructor))
|
||||
void caps_so_fini()
|
||||
{
|
||||
for (ulong i = 0; i < N; ++i)
|
||||
@@ -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" */
|
||||
|
||||
@@ -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(
|
||||
@@ -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()
|
||||
|
||||
Submodule plugins/LadspaEffect/cmt/cmt updated: d8bf8084aa...24599fb45b
@@ -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")
|
||||
@@ -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})
|
||||
|
||||
@@ -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)
|
||||
@@ -24,4 +31,3 @@ FOREACH(_item ${PLUGIN_SOURCES})
|
||||
TARGET_LINK_LIBRARIES("${_plugin}" m)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user