diff --git a/libs/juce6.0/meson.build b/libs/juce6.0/meson.build index 9619b3b1..4d564b34 100644 --- a/libs/juce6.0/meson.build +++ b/libs/juce6.0/meson.build @@ -38,6 +38,7 @@ juce60_extra_cpp_args = [ '-std=gnu++14', '-Wno-non-virtual-dtor', ] +juce60_extra_include_dirs = [] if os_windows juce60_extra_cpp_args += [ @@ -45,6 +46,9 @@ if os_windows '-D__wchar_t=wchar_t', '-Wno-unknown-pragmas', ] + juce60_extra_include_dirs += [ + include_directories('../mingw-std-threads'), + ] if host_machine.cpu() == 'x86' juce60_extra_cpp_args += [ '-mpreferred-stack-boundary=2', @@ -59,6 +63,7 @@ lib_juce60 = static_library('juce60', include_directories('source'), include_directories('source/modules'), include_directories('../juced/source/dependancies/ladspa_sdk/src'), + juce60_extra_include_dirs ], cpp_args: build_flags_cpp + juce60_extra_cpp_args, dependencies: dependencies, @@ -72,6 +77,7 @@ lib_juce60_device = static_library('juce60-devices', include_directories('.'), include_directories('source'), include_directories('source/modules'), + juce60_extra_include_dirs ], cpp_args: build_flags_cpp + juce60_extra_cpp_args + ['-DJUCE_MODULE_AVAILABLE_juce_audio_devices=1'], dependencies: dependencies_devices, diff --git a/libs/juce6.0/source/modules/juce_core/threads/juce_WaitableEvent.h b/libs/juce6.0/source/modules/juce_core/threads/juce_WaitableEvent.h index 67090365..52269f70 100644 --- a/libs/juce6.0/source/modules/juce_core/threads/juce_WaitableEvent.h +++ b/libs/juce6.0/source/modules/juce_core/threads/juce_WaitableEvent.h @@ -20,10 +20,6 @@ ============================================================================== */ -#if JUCE_MINGW && !defined(_GLIBCXX_HAS_GTHREADS) -#include "mingw-std-threads/mingw.condition_variable.h" -#endif - namespace juce { diff --git a/libs/juce6.1/meson.build b/libs/juce6.1/meson.build index 4588bc2b..98757f65 100644 --- a/libs/juce6.1/meson.build +++ b/libs/juce6.1/meson.build @@ -38,6 +38,7 @@ juce61_extra_cpp_args = [ '-std=gnu++14', '-Wno-non-virtual-dtor', ] +juce61_extra_include_dirs = [] if os_windows juce61_extra_cpp_args += [ @@ -45,6 +46,9 @@ if os_windows '-D__wchar_t=wchar_t', '-Wno-unknown-pragmas', ] + juce61_extra_include_dirs += [ + include_directories('../mingw-std-threads'), + ] if host_machine.cpu() == 'x86' juce61_extra_cpp_args += [ '-mpreferred-stack-boundary=2', @@ -59,6 +63,7 @@ lib_juce6 = static_library('juce61', include_directories('source'), include_directories('source/modules'), include_directories('../juced/source/dependancies/ladspa_sdk/src'), + juce61_extra_include_dirs ], cpp_args: build_flags_cpp + juce61_extra_cpp_args, dependencies: dependencies, @@ -72,6 +77,7 @@ lib_juce61_device = static_library('juce61-devices', include_directories('.'), include_directories('source'), include_directories('source/modules'), + juce61_extra_include_dirs ], cpp_args: build_flags_cpp + juce61_extra_cpp_args + ['-DJUCE_MODULE_AVAILABLE_juce_audio_devices=1'], dependencies: dependencies_devices, diff --git a/libs/juce7/meson.build b/libs/juce7/meson.build index 887824aa..5b8e5848 100644 --- a/libs/juce7/meson.build +++ b/libs/juce7/meson.build @@ -38,8 +38,12 @@ juce7_extra_cpp_args = [ '-std=gnu++14', '-Wno-non-virtual-dtor', ] +juce7_extra_include_dirs = [] if os_windows + juce7_extra_include_dirs += [ + include_directories('../mingw-std-threads'), + ] if host_machine.cpu() == 'x86' juce7_extra_cpp_args += [ '-mpreferred-stack-boundary=2', @@ -54,6 +58,7 @@ lib_juce7 = static_library('juce7', include_directories('source'), include_directories('source/modules'), include_directories('../juced/source/dependancies/ladspa_sdk/src'), + juce7_extra_include_dirs ], cpp_args: build_flags_cpp + juce7_extra_cpp_args, dependencies: dependencies, @@ -67,6 +72,7 @@ lib_juce7_device = static_library('juce7-devices', include_directories('.'), include_directories('source'), include_directories('source/modules'), + juce7_extra_include_dirs ], cpp_args: build_flags_cpp + juce7_extra_cpp_args + ['-DJUCE_MODULE_AVAILABLE_juce_audio_devices=1'], dependencies: dependencies_devices, diff --git a/libs/juce7/source/modules/juce_gui_basics/juce_gui_basics.cpp b/libs/juce7/source/modules/juce_gui_basics/juce_gui_basics.cpp index 944d25b1..574229ca 100644 --- a/libs/juce7/source/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/libs/juce7/source/modules/juce_gui_basics/juce_gui_basics.cpp @@ -68,9 +68,9 @@ #include #include #include - #include #if JUCE_MSVC + #include #include #endif diff --git a/libs/meson.build b/libs/meson.build index f57b05b5..72609bdd 100644 --- a/libs/meson.build +++ b/libs/meson.build @@ -16,8 +16,9 @@ if not (build_juce5_only or build_juce60_only or build_juce7_only) subdir('juce6.1') endif -if not (build_juce5_only or build_juce60_only or build_juce61_only) - subdir('juce7') -endif +# no plugins imported that use juce7 yet +# if not (build_juce5_only or build_juce60_only or build_juce61_only) +# subdir('juce7') +# endif ############################################################################### diff --git a/libs/mingw-std-threads/condition_variable b/libs/mingw-std-threads/condition_variable new file mode 100644 index 00000000..4f7c75bc --- /dev/null +++ b/libs/mingw-std-threads/condition_variable @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.condition_variable.h" diff --git a/libs/mingw-std-threads/future b/libs/mingw-std-threads/future new file mode 100644 index 00000000..4a7c14eb --- /dev/null +++ b/libs/mingw-std-threads/future @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.future.h" diff --git a/libs/mingw-std-threads/invoke b/libs/mingw-std-threads/invoke new file mode 100644 index 00000000..abf27da4 --- /dev/null +++ b/libs/mingw-std-threads/invoke @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.invoke.h" diff --git a/libs/mingw-std-threads/mutex b/libs/mingw-std-threads/mutex new file mode 100644 index 00000000..1e629290 --- /dev/null +++ b/libs/mingw-std-threads/mutex @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.mutex.h" diff --git a/libs/mingw-std-threads/shared_mutex b/libs/mingw-std-threads/shared_mutex new file mode 100644 index 00000000..cde69f99 --- /dev/null +++ b/libs/mingw-std-threads/shared_mutex @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.shared_mutex.h" diff --git a/libs/mingw-std-threads/thread b/libs/mingw-std-threads/thread new file mode 100644 index 00000000..09a7758f --- /dev/null +++ b/libs/mingw-std-threads/thread @@ -0,0 +1,6 @@ +// Copyright 2023 Filipe Coelho +// SPDX-License-Identifier: 0BSD OR ISC + +#pragma once +#include_next +#include "mingw.thread.h" diff --git a/meson.build b/meson.build index faa0d837..1fb4b100 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,23 @@ project('DISTRHO-Ports', license : 'GPLv3' ) +############################################################################### +# set target OS + +os_darwin = false +os_linux = false +os_windows = false + +if host_machine.system() == 'darwin' + os_darwin = true +elif host_machine.system() == 'windows' + os_windows = true +elif host_machine.system() == 'linux' + os_linux = true +else + error('unsupported system') +endif + ############################################################################### # get options @@ -27,7 +44,7 @@ build_juce61_only = get_option('build-juce61-only') build_juce7_only = get_option('build-juce7-only') build_universal = get_option('build-universal') optimizations = get_option('optimizations') and buildtype != 'debug' -lto_optimizations = get_option('lto-optimizations') and buildtype != 'debug' +lto_optimizations = get_option('lto-optimizations') and buildtype != 'debug' and not os_windows sse_optimizations = get_option('sse-optimizations') and buildtype != 'debug' ############################################################################### @@ -37,23 +54,6 @@ lv2dir = prefix / libdir / 'lv2' vst2dir = prefix / libdir / 'vst' vst3dir = prefix / libdir / 'vst3' -############################################################################### -# set target OS - -os_darwin = false -os_linux = false -os_windows = false - -if host_machine.system() == 'darwin' - os_darwin = true -elif host_machine.system() == 'windows' - os_windows = true -elif host_machine.system() == 'linux' - os_linux = true -else - error('unsupported system') -endif - ############################################################################### # set OS-specific details @@ -326,9 +326,10 @@ if not (build_juce5_only or build_juce60_only or build_juce7_only) subdir('ports-juce6.1') endif -if not (build_juce5_only or build_juce60_only or build_juce61_only) - subdir('ports-juce7') -endif +# no plugins imported that use juce7 yet +# if not (build_juce5_only or build_juce60_only or build_juce61_only) +# subdir('ports-juce7') +# endif ############################################################################### # extra files to install diff --git a/ports-juce6.0/meson.build b/ports-juce6.0/meson.build index a2a62169..702d523e 100644 --- a/ports-juce6.0/meson.build +++ b/ports-juce6.0/meson.build @@ -16,6 +16,7 @@ plugin_include_dirs = [ include_directories('../libs/juce6.0/source/modules'), include_directories('../libs/juce6.0/source/modules/juce_audio_processors/format_types/VST3_SDK'), include_directories('../libs/juce-plugin'), + juce60_extra_include_dirs ] ############################################################################### diff --git a/ports-juce6.0/vitalium/source/synthesis/producers/sample_source.cpp b/ports-juce6.0/vitalium/source/synthesis/producers/sample_source.cpp index ce66bbba..f31d0416 100644 --- a/ports-juce6.0/vitalium/source/synthesis/producers/sample_source.cpp +++ b/ports-juce6.0/vitalium/source/synthesis/producers/sample_source.cpp @@ -18,11 +18,7 @@ #include "futils.h" #include "synth_constants.h" -#ifdef __MINGW32__ -#include "mingw-std-threads/mingw.thread.h" -#else #include -#endif namespace vital { diff --git a/ports-juce6.1/meson.build b/ports-juce6.1/meson.build index 5c4ada2c..c83465f2 100644 --- a/ports-juce6.1/meson.build +++ b/ports-juce6.1/meson.build @@ -17,6 +17,7 @@ plugin_include_dirs = [ include_directories('../libs/juce6.1/source/modules'), include_directories('../libs/juce6.1/source/modules/juce_audio_processors/format_types/VST3_SDK'), include_directories('../libs/juce-plugin'), + juce61_extra_include_dirs ] ############################################################################### diff --git a/ports-juce7/meson.build b/ports-juce7/meson.build index bf6e0c94..cf3b3162 100644 --- a/ports-juce7/meson.build +++ b/ports-juce7/meson.build @@ -15,6 +15,7 @@ plugin_include_dirs = [ include_directories('../libs/juce7/source/modules/juce_audio_processors/format_types/LV2_SDK'), include_directories('../libs/juce7/source/modules/juce_audio_processors/format_types/VST3_SDK'), include_directories('../libs/juce-plugin'), + juce7_extra_include_dirs ] ###############################################################################