Commit Graph

58 Commits

Author SHA1 Message Date
Leland Lucius 0b716cabee No longer need to use the obsolute functions
The last commit resolved this requirement.  I'd really like to
remove ALL of the old dynamic loading code from ExportMP3 as well,
but a task for another day...
2020-04-17 08:48:53 -05:00
Leland Lucius 5cd94707f8 Prefer shared libs over static 2020-04-06 07:31:32 -05:00
Carlo Bramini f60bd42e9d
[CMAKE] Portaudio: do not activate OSS on Windows (#477)
* [CMAKE] Portaudio: do not activate OSS on Windows

I had a strange error when building the local portaudio library with MinGW under msys2.
The error was caused by the file sys/soundcard.h that was found somewhere in the path, because use_pa_oss is always activated regardless the platform.
So, in my opinion it is better to not activate this option if the platform is Windows.
Afterall, it is useless in this case.

* [CMAKE] Portaudio: move also remaining OSS code
2020-04-02 10:04:10 -05:00
Carlo Bramini 1437fb38ad
[CMAKE] Portaudio: x86_plain_converters is MSVC only (#476)
As you can see from the original CMakeLists.txt into the sources of Portaudio, the file pa_x86_plain_converters.c can be compiled only with Visual C++, so it should not be include if there is not the Microsoft Compiler.
2020-04-02 09:34:28 -05:00
Leland Lucius 11bfccba53 Remove a couple more unneeded quotes 2020-04-01 18:54:49 -05:00
Leland Lucius ffc7452eba Fix quoting issue in libsoxr build 2020-04-01 14:30:26 -05:00
Carlo Bramini 3a91981c86
[CMAKE] LV2: Fix conflict with main() (#468)
After compiling Audacity with MinGW, a strange message appeared on the console after the executable was launched:

# ./Audacity.exe
Usage: C:\msys64\home\Carlo\a\bin\Audacity.exe [OPTION]... INPUT...
Validate RDF data

  -h  Display this help and exit
  -l  Print errors on a single line.
  -v  Display version information and exit
Validate RDF data.  This is a simple validator which checks
that all used properties are actually defined.  It does not do
any fancy file retrieval, the files passed on the command line
are the only data that is read.  In other words, you must pass
the definition of all vocabularies used on the command line.

The problem happens because the file lv2/sord/src/sord_validate.c contains a main() function that was called by crt startup code instead of the one in the main sources of Audacity. The solution is to not include this unneeded file.
2020-03-24 22:58:28 -05:00
Carlo Bramini 22b47bf0ae
[CMAKE] LAME: fix compilation error. (#466)
If you try to build local LAME with CMake for i686, you get many error messages like this one:

C:/cygwin64/home/Carlo/audacity/lib-src/libmp3lame/vector/xmm_quantize_sub.c: In function 'init_xrpow_core_sse':
C:/cygwin64/home/Carlo/audacity/lib-src/libmp3lame/vector/xmm_quantize_sub.c:72:18: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]

The solution is to add the option provided by SSE_FLAGS.
So, I replicated in this PR the same fix made for local soundtouch library.
2020-03-24 13:54:21 -05:00
Raphael Graf a787fe9a1f
[CMAKE] Allow linking system version of libexpat (#462) 2020-03-23 08:12:42 -05:00
Leland Lucius 6f5f586b19 Update required libsndfile version in CMake build 2020-03-18 16:36:23 -05:00
Leland Lucius 7256696047 Adjust CMake build for new libsndfile version 2020-03-17 00:14:47 -05:00
Leland Lucius f14a3dd90f Don't need to show the command any longer
Seems to be working just fine after several pulls
so don't need to see it anymore.
2020-03-11 23:50:32 -05:00
Leland Lucius 66aae0900b Ease CMake and legacy build coexistence
Cliff noticed that the CMake git ident was not being updated when
pulling new changes.  This was because it was getting captured at
configuration time and, even if you pull more changes, the CMake
configuration may not be redone automatically if the build files
weren't also changed.

So, this adds a new target to get the information at build time
instead.
2020-03-11 22:31:19 -05:00
Carlo Bramini 3d38ddf6a2
[CMAKE] Portmidi: add missing Unix files in Cygwin (#442)
When doing the final link of Audacity executable on Cygwin, many errors like this one were printed on the console:

ld: ../lib/audacity/libportmidi.a(portmidi.c.o):portmidi.c:(.text+0x3f): undefined reference to `pm_alloc'

This happened because some files were missing since Cygwin name was not included together with other unix platforms.
2020-03-03 17:06:42 -06:00
Carlo Bramini d8362e0897
[CMAKE] Portaudio: fix support in Cygwin (#438)
* [CMAKE] Portaudio: add unix paths for Cygwin

When building on Cygwin, I got this error:

/home/carlo/audacity/lib-src/portaudio-v19/src/hostapi/oss/pa_unix_oss.c:90:10: fatal error: pa_unix_util.h: No such file or directory
   90 | #include "pa_unix_util.h"

this happened because some additional search path was not included.

* [CMAKE] Portaudio: add missing Unix files in Cygwin

When doing the final link of Audacity executable on Cygwin, many errors like this one were printed on the console.

/usr/lib/gcc/x86_64-pc-cygwin/9.2.0/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/Audacity.dir/AudioIO.cpp.o:AudioIO.cpp:(.text+0x17a): undefined reference to `PaUtil_GetTime'

This happened because some files were missing since Cygwin name was not included together with other unix platforms.
2020-03-02 23:31:56 -06:00
Leland Lucius 2a4421bf92 Remove sc4 plugin from CMake build 2020-03-01 12:12:37 -06:00
Leland Lucius caab2a56c9 Remove gettext download for Mac in CMake build
And added a python version that will be used on all platforms
when a suitable msgfmt isn't installed.  (As long as python
is installed.)

Extracted all the Audacity specific functions from main cmake
list and moved them to their own module.

Rearrange the main cmake module a bit and misc. cleanup.
2020-02-29 01:49:55 -06:00
Raphael Graf dff2124be2
Fix requirements for libmad and lv2 in cmake-proxies/CMakeLists.txt (#435) 2020-02-27 10:49:49 -06:00
Leland Lucius 96572761c4 Fix linkage to sc4 plug-in 2020-02-27 09:58:24 -06:00
Leland Lucius 50e4d74007 Make Audacity dependent on sc4 plugin 2020-02-27 01:08:46 -06:00
Leland Lucius 5d62cdbd1e Add sc4 plug-in to CMake build for Windows and Mac 2020-02-27 00:52:34 -06:00
Leland Lucius 3545097fe9 Fix CMake/wxWidgets link issue
This corrects linking of the wxWidgets libraries when there's multiple
copies and the desired one is later in the search path.  This can affect
any non-Windows system that doesn't have it's wxWidgets in "standard"
libraries (like our wxWidgets builds on the Mac).

The wrong wxWidgets libraries can be picked up by the linker if other
"-L" arguments appear before the wxWidgets specific on.  This can happen
if you have something like Homebrew installed and CMake finds one of the
libraries (like libogg) installed.  It will put a "-L/usr/local/lib" in
the linker arguments before the "-L/usr/local/x86_64" wxWidgets flag,
and if there happens to be wxWidgets libs in /usr/local/lib, the linker
will pull the wxWidgets libs from /usr/local/lib...not what was wanted.
2020-02-24 13:45:16 -06:00
Leland Lucius d748c0816a Actually do what the previous change said
Forgot to actually exclude mod-null and mod-nyq-bench from the
build.

Fixed a few typos.

And removed "zip" from the package install on Ubuntu since it's
not needed anymore.
2020-02-23 16:46:30 -06:00
Leland Lucius f3ce60ae7a Fix the Github CMake build
Restore the wxDEBUG_LEVEL defines for the module builds.  It is
currently required (see explanation in CMakeLists.txt)

Add explanantion of why wxWidgets_USE_REL_AND_DBG=NO is needed
for the Github Windows build.

Further restrict the disabling dynamic loading for Windows and Mac
of the Lame and FFmpeg libs.  Some corrections need to be made in
ExportMP3.cpp (and probably some for FFmpeg as well).

And don't build mod-nyq-bench or mod-null by default until they
can be fixed.  (They fail to build.)
2020-02-23 16:35:58 -06:00
Leland Lucius a8ee0b8c7c More cmake updates and cleanup
Visual Studio NuGet package handling was redone to correct a
chicken and egg situation. (See the nuget_package() function
in audacity/CMakeLists.txt.

Due to the change in NuGet handling, was finally able to make
the Audacity target dependent on several other targets.  This
ensures the destination directory is populated correctly.

Library handling for system packages reworked to ensure the
correct libraries are used and to "workaround" an issue where
the libraries weren't being included in the link command...no
idea why.  New way is better anyway.

Don't allow a system library for SBSMS since it seems we have
a unique (Audacity-only???) version.

Don't define wxDEBUG_LEVEL.  It's not needed and causes duplicate
symbol warnings.

A couple of small changes to config files to remove libmad and
libsndfile warnings.

Do not include serdi.c and sordi.c in the LV2 build.

Fix handling of static Lame and linked FFmpeg libs.

Use cmake file() instead of gcc/awk to extract version information
from Audacity.h for the Mac Info.plist.

Use "cmake -E tar" to zip artifacts in github action.
2020-02-23 03:57:31 -06:00
Leland Lucius 14aad758fa Print various sundries about the build
To (hopefully) assist in debugging build problems.
2020-02-20 23:41:09 -06:00
Leland Lucius 53840f7a3e Various fixes to CMake build
Mostly a result of not defining __WXMSW__, but the portmixer cmakelist
wasn't looking for the right portaudio variables.
2020-02-19 10:53:50 -06:00
Leland Lucius c82b13871f Make sure debug level is properly set
Otherwise, a mix of Debug and Release builds can occur.
2020-02-18 20:17:36 -06:00
Leland Lucius 04f0c2d9ee Add cmake build of mod-null 2020-02-18 20:16:37 -06:00
Leland Lucius e07b5df6f3 Reworked cmake command options
And fixed a recursion problem when copying DLLs to dest folder

The command options are now:

   // Enable Audio Unit plug-in support
   audacity_enable_audiounits:BOOL=ON

   // Library preference [system (if available), local]
   audacity_lib_preference:STRING=system

   // Use FileDialog library [local]
   audacity_use_FileDialog:STRING=local

   // Use expat library [local]
   audacity_use_expat:STRING=local

   // Use ffmpeg library [loaded, off]
   audacity_use_ffmpeg:STRING=off

   // Use flac library [system (if available), local, off]
   audacity_use_flac:STRING=local

   // Use id3tag library [system (if available), local, off]
   audacity_use_id3tag:STRING=local

   // Use LADSPA plug-in support [on, off]
   audacity_use_ladspa:BOOL=ON

   // Use lame library [system (if available), local]
   audacity_use_lame:STRING=local

   // Use libextra library [local]
   audacity_use_libextra:STRING=local

   // Use lv2 library [system (if available), local, off]
   audacity_use_lv2:STRING=local

   // Use mad library [system (if available), local, off]
   audacity_use_mad:STRING=local

   // Use midi library [system (if available), local, off]
   audacity_use_midi:STRING=local

   // Use nyquist library [local, off]
   audacity_use_nyquist:STRING=local

   // Use ogg library [system (if available), local, off]
   audacity_use_ogg:STRING=local

   // Use the portaudio CoreAudio interface if available
   audacity_use_pa_coreaudio:BOOL=YES

   // Use the JACK audio interface if available [loaded, linked, off]
   audacity_use_pa_jack:STRING=off

   // Use the OSS audio interface if available
   audacity_use_pa_oss:BOOL=NO

   // Use portaudio library [local]
   audacity_use_portaudio:STRING=local

   // Use portmixer library [local, off]
   audacity_use_portmixer:STRING=local

   // Use portsmf library [system (if available), local, off]
   audacity_use_portsmf:STRING=local

   // Use sbsms library [system (if available), local, off]
   audacity_use_sbsms:STRING=local

   // Use sndfile library [system (if available), local]
   audacity_use_sndfile:STRING=local

   // Use soundtouch library [system (if available), local, off]
   audacity_use_soundtouch:STRING=local

   // Use soxr library [system (if available), local]
   audacity_use_soxr:STRING=local

   // Use twolame library [system (if available), local, off]
   audacity_use_twolame:STRING=local

   // Use vamp library [system (if available), local, off]
   audacity_use_vamp:STRING=local

   // Use vorbis library [system (if available), local, off]
   audacity_use_vorbis:STRING=local

   // Use VST2 plug-in support [on, off]
   audacity_use_vst:BOOL=ON

   // Use wxwidgets library [system (if available), local]
   audacity_use_wxwidgets:STRING=system
2020-02-14 15:56:33 -06:00
Leland Lucius db70394964 Changes to detect 64-bit builds correctly 2020-02-12 13:08:41 -06:00
Leland Lucius 2430582e90 Destination for file() is always a directory
Thanks RenÃ
2020-02-12 07:54:33 -06:00
Leland Lucius e79274a403 Various cmake changes
Mostly from suggestions, but there's a couple of other minor
fixes and additions:

   Cmake not decides with SDK to use on Windows

   All Audacity cmake options are not prefixed with "audacity_", but this
   is configurable in audacity/CMakeLists.txt

   Several other options have been marked advanced so they don't clutter
   the CMake GUI

   On Windows, multiple processors will now be used reducing build time
   considerably

   Quieted a couple of package messages that the user doesn't need to see

   No longer tried to create aliases on Windows

   No longer used precompiled headers if ccache is available

   On Windows, only copies the needed wxWidgets and VC runtime libraries
   to the bin directory
2020-02-12 01:05:51 -06:00
Leland Lucius 70bbfb69d5 Last major update to the cmake build
I'm sure there will be further minor updates, but this
should be the last major update and it should be ready
for testing.

Audacity specific cmake options (cmake -Doption=<yes|no>) include:

   // Disable dynamic loading of ffmpeg libraries
   disable_dynamic_ffmpeg:BOOL=OFF

   // Disable dynamic loading of JACK libraries
   disable_dynamic_jack:BOOL=ON

   // Enable ffmpeg library
   enable_ffmpeg:BOOL=ON

   // Enable flac library
   enable_flac:BOOL=ON

   // Enable id3tag library
   enable_id3tag:BOOL=ON

   // Enable LADSPA plug-in support
   enable_ladspa:BOOL=ON

   // Enable lv2 library
   enable_lv2:BOOL=ON

   // Enable mad library
   enable_mad:BOOL=ON

   // Enable midi library
   enable_midi:BOOL=ON

   // Enable nyquist library
   enable_nyquist:BOOL=ON

   // Enable ogg library
   enable_ogg:BOOL=ON

   // Enable portmixer library
   enable_portmixer:BOOL=ON

   // Enable portsmf library
   enable_portsmf:BOOL=ON

   // Enable sbsms library
   enable_sbsms:BOOL=ON

   // Enable soundtouch library
   enable_soundtouch:BOOL=ON

   // Enable twolame library
   enable_twolame:BOOL=ON

   // Enable vamp library
   enable_vamp:BOOL=ON

   // Enable vorbis library
   enable_vorbis:BOOL=ON

   // Enable VST2 plug-in support
   enable_vst:BOOL=ON

   // Use system libraries if available
   prefer_system_libs:BOOL=ON

   // Enable the portaudio ALSA interface if available
   use_pa_alsa:BOOL=ON

   // Enable the portaudio CoreAudio interface if available
   use_pa_coreaudio:BOOL=ON

   // Enable the portaudio DirectSound interface if available
   use_pa_ds:BOOL=ON

   // Use the JACK audio interface if available
   use_pa_jack:BOOL=ON

   // Use the OSS audio interface if available
   use_pa_oss:BOOL=ON

   // Enable the portaudio WASAPI interface if available
   use_pa_wasapi:BOOL=ON

   // Enable the portaudio WMME interface if available
   use_pa_wmme:BOOL=ON

   // Use ffmpeg system library if available
   use_system_ffmpeg:BOOL=ON

   // Use flac system library if available
   use_system_flac:BOOL=ON

   // Use id3tag system library if available
   use_system_id3tag:BOOL=ON

   // Use lame system library if available
   use_system_lame:BOOL=ON

   // Use lv2 system library if available
   use_system_lv2:BOOL=ON

   // Use mad system library if available
   use_system_mad:BOOL=ON

   // Use midi system library if available
   use_system_midi:BOOL=ON

   // Use ogg system library if available
   use_system_ogg:BOOL=ON

   // Use portsmf system library if available
   use_system_portsmf:BOOL=ON

   // Use sbsms system library if available
   use_system_sbsms:BOOL=ON

   // Use sndfile system library if available
   use_system_sndfile:BOOL=ON

   // Use soundtouch system library if available
   use_system_soundtouch:BOOL=ON

   // Use soxr system library if available
   use_system_soxr:BOOL=ON

   // Use twolame system library if available
   use_system_twolame:BOOL=ON

   // Use vamp system library if available
   use_system_vamp:BOOL=ON

   // Use vorbis system library if available
   use_system_vorbis:BOOL=ON

   // Use wxwidgets system library if available
   use_system_wxwidgets:BOOL=ON
2020-02-11 01:15:26 -06:00
Leland Lucius c2888302fd Fix debug/release mismatch
Visual Studio doesn't like mixing debug and non-debug code.
2020-02-06 23:31:28 -06:00
Leland Lucius 2ec12c150b Fix multi-config builds
Hopefully, this corrects the handling of the different
configs like Debug, Release, etc, when dealing with
multi-config generators.
2020-02-06 20:10:29 -06:00
Leland Lucius f0e3ee2cde More cmake updates
Added install target (this is mainly for Linux)
Added mod-nyq-bench

More to come...
2020-02-06 01:17:20 -06:00
Leland Lucius 2df9d3528b Add mod-nyq-bench target
And define a few more convenience variables.
2020-02-05 18:45:05 -06:00
Leland Lucius 2e113ba0a5 More cmake updates
Uses system libraries by default with a fallback to local
Adds the Wrapper build on OSX
Adds mod_script_pipe
Adds ffmpeg
Some additional cleanup
2020-02-05 11:10:22 -06:00
Leland Lucius e2a7204403 Provides to use the system wxWidgets install
The default is to use the system one if found.  If the
WXWIN environment variable is set and points to a valid
wxWidgets tree, that will be used.  Otherwise, it will
search the platform specific locations.

You can use a local library instead with:

   cmake -Duse_system_wxwigets=no ...

In this case it will look for the WXWIN environment variable
and use that or it will download the Audacity specific wxWidgets
source.  In both cases, wxWidgets will be built as part of the
Audacity project.
2020-02-03 19:05:32 -06:00
Leland Lucius ad77faca0d Use libraries not options
The ensures that any extra libraries (like "libm") get passed
at the end of the compile command.  Mattered on Ubuntu, but
not on Fedora.
2020-02-03 16:00:47 -06:00
Leland Lucius d213179767 Emit the error output during clipping check
It sort of helps to have the actual messages to assist
in diagnosis.
2020-02-03 13:55:47 -06:00
Leland Lucius 6217351a12 Updates the cmake build system
It's still has some work, but it successfully builds on
all 3 main platforms.  Some of the outstanding items
include:

   Install target testing (mostly important for Linux)
   CMakeList clean up and comments
   Debug and Release build verification
   Audit of compile/link options
   Need a Mac signed and notarized build
   (and probably more)
2020-02-03 00:39:43 -06:00
Виталий Кирсанов ca0bf0c12d Fixed library names for FLAC and portmidi 2019-04-14 21:29:35 +01:00
Vitaliy Kirsanov 5e2a426cb3 CMakeLists.txt for portmixer and portaudio
The support of ALSA, OSS and CoreAudio was added to portaudio. portmixer
was updated accordingly.
2019-04-11 22:35:21 +01:00
Vitaliy Kirsanov 67386e7799 Connected libFLAC with libogg 2019-04-05 22:11:50 +01:00
Vitaliy Kirsanov b07595781a CMakeLists.txt for libFLAC been rewritten
I've reproduced the commands from FLAC's configure.ac. Seems to build fine on Windows, MacOS, Linux and FreeBSD
2019-04-04 07:25:44 +01:00
Vitaliy Kirsanov 26cf3aba95 Use native CMakeLists.txt for portmidi
Seems to work fine on Windows, OSX and Linux
2019-03-24 18:29:53 +00:00
Vitaly Kirsanov 2b2c13520d Use native CMakeLists.txt for portaudio
The same story as libexpat's one--native CMakeLists.txt does its job better
than the proxy. Also it seems to be able to otionally build with ASIO support
on Windows. And it successfully builds on linux, freebsd and osx.
2019-03-20 20:22:23 +00:00
Vitaliy Kirsanov b15a11b830 CMakeLists.txt for FileDialog's been rewritten
It appeared to be usable on Windows but still wasn't flexible. I've
updated it with commands based on the autotools configs and now
filedialog can be built on linux, macos and freebsd using cmake.
2019-03-18 21:39:40 +00:00