Commit Graph

194 Commits

Author SHA1 Message Date
derselbst a01917baa2 Remove enable-debug cmake option 2021-10-17 18:31:43 +02:00
derselbst bb3bc6da26 Remove enable-pkgconfig cmake option 2021-10-17 18:31:07 +02:00
derselbst 90da8af70f Merge branch 'master' into cmake-modernization 2021-10-17 18:23:09 +02:00
Nikos Chantziaras de05ef2a1c
Fix static mingw linking issues (#990)
* add missing link to libmman
* more complete list of private dependencies in pkg-config file
2021-10-17 18:12:49 +02:00
Nikos Chantziaras db5db4b845
Add cmake build option for disabling OpenMP (#986)
In my case this is because of issue #985, but there's also the use case of being able to test without OpenMP. For example, to disable it on my system in order to test if the crash had anything to do with OpenMP, I had to manually edit `CMakeLists.txt` each time I wanted to turn it off and on again.
2021-09-28 21:53:08 +02:00
Pedro López-Cabanillas 563592aa3d Adopting GNUInstallDirs
* removed and/or replaced most definitions from DefaultDirs.cmake
* removed LIB_SUFFIX
* fixed DEFAULT_SOUNDFOUNT in Windows
2021-09-15 22:56:05 +02:00
derselbst 926581851e Bump to 2.2.3 2021-09-11 18:26:35 +02:00
Pedro López-Cabanillas 6a0d838f33 Fixed OpenMP detection and building, better PkgConfigHelpers.cmake 2021-09-11 18:09:52 +02:00
Pedro López-Cabanillas 55678a078a new macros in pkgconfighelpers.cmake
* sanitize_target_dirs(target) removes include and link directories that
do not exist from the given immported target
* generate_pkgconfig_spec() builds fluidsynth.pc taking the private
libraries from a given target dependencies
2021-09-05 21:56:52 +02:00
Pedro López-Cabanillas 5a71336bd9 replaced global include_directories and link_directories
* by target_include_directories
* by target_link_libraries, using imported targets when possible
2021-09-05 11:30:25 +02:00
Pedro López-Cabanillas 66b77bfb6f
cmake modernization, tasks 1 & 2 (#970)
* raised cmake_minimum_required ( VERSION 3.13 )
* removed other CMAKE_VERSION checks
* fixed overlinking of library, cmdline client, and unit tests
2021-09-03 12:21:05 +02:00
Pedro López-Cabanillas ebed81099d Clarifications 2021-09-01 21:03:10 +02:00
Pedro López-Cabanillas 7ca3407d30 fixes and simplifications
* FluidSynthConfigVersion.cmake is created with ${VERSION} instead of
${LIB_VERSION_INFO}
* FluidSynthConfig.cmake.in simplified: it doesn't need to include the
version file.
* Simplified BUILD_INTERFACE generator expression as suggested
2021-09-01 21:00:30 +02:00
Pedro López-Cabanillas ad4f1b9191 cmake: export targets
The build system creates two exported targets:
- The executable FluidSynth::fluidsynth
- The library FluidSynth::libfluidsynth

A downstream project using CMake can find and link the library target
directly with cmake (without needing pkg-config) this way:

~~~
project(sample LANGUAGES C)
find_package ( FluidSynth )
if (FluidSynth_FOUND)
  add_executable( sample sample.c )
  target_link_libraries ( sample PRIVATE FluidSynth::libfluidsynth )
endif ()
~~~

After installing fluidsynth in a prefix like "$HOME/Fluidsynth3":
cmake -DCNAKE_PREFIX_PATH="$HOME/Fluidsynth3/;..."

Instead installing, the build directory can be used directly, for
instance:

cmake -DFluidSynth_DIR="$HOME/fluidsynth-2.2.2/build/" ...
2021-09-01 21:00:18 +02:00
derselbst e6ce0f4845 Remove fluidsynth.spec.in in favor of contrib/fluidsynth.spec 2021-09-01 19:53:58 +02:00
Tom M fab1ca1ca9
Revert "cmake: export targets" 2021-08-30 16:07:53 +02:00
derselbst fefd22a9d6 Remove fluidsynth.spec.in in favor of contrib/fluidsynth.spec 2021-08-28 23:23:34 +02:00
Pedro López-Cabanillas f023d7e014 Reverted PRIVATE in target_link_libraries() and clarifications 2021-08-02 11:31:43 +02:00
Pedro López-Cabanillas 64a7787e90 fixes and simplifications
* FluidSynthConfigVersion.cmake is created with ${VERSION} instead of
${LIB_VERSION_INFO}
* FluidSynthConfig.cmake.in simplified: it doesn't need to include the
version file.
* Simplified BUILD_INTERFACE generator expression as suggested
2021-08-02 11:31:43 +02:00
Pedro López-Cabanillas cf5fbac9af cmake: export targets
The build system creates two exported targets:
- The executable FluidSynth::fluidsynth
- The library FluidSynth::libfluidsynth

A downstream project using CMake can find and link the library target
directly with cmake (without needing pkg-config) this way:

~~~
project(sample LANGUAGES C)
find_package ( FluidSynth )
if (FluidSynth_FOUND)
  add_executable( sample sample.c )
  target_link_libraries ( sample PRIVATE FluidSynth::libfluidsynth )
endif ()
~~~

After installing fluidsynth in a prefix like "$HOME/Fluidsynth3":
cmake -DCNAKE_PREFIX_PATH="$HOME/Fluidsynth3/;..."

Instead installing, the build directory can be used directly, for
instance:

cmake -DFluidSynth_DIR="$HOME/fluidsynth-2.2.2/build/" ...
2021-08-02 11:31:43 +02:00
Tom M 8e56188316
Define socklen_t in according to a feature test (#949)
Co-authored-by: KO Myung-Hun <komh@chollian.net>
2021-07-28 11:00:27 +02:00
Tom M ec6d563c39
Fix VERSION_GREATER_EQUAL for CMAKE < v3.7 (#950)
VERSION_GREATER_EQUAL was introduced in CMAKE v3.7.

Co-authored-by: KO Myung-Hun <komh@chollian.net>
2021-07-28 10:49:57 +02:00
Ghabry 0e3411cba4 Emscripten: --as-needed is not supported 2021-07-19 00:36:31 +02:00
Ghabry 475f902584 Fix emscripten: Append CMAKE_MODULE_PATH instead of overwriting it
Emscripten adds a custom CMAKE_MODULE_PATH in the toolchain file.
Without these modules TestBigEndian fails.
2021-07-19 00:27:34 +02:00
Tom M fc21d284dc
Fix Fluidsynth.pc doesn't include static libraries (#933) 2021-07-11 17:37:54 +02:00
luz paz e4c8ef080c Fix source comment typos
Found via `codespell -q 3 -S ChangeLog -L bloc,blocs,capela,parms,readd,seh`
2021-07-10 08:44:35 -04:00
derselbst aa2561d091 Bump to 2.2.2 2021-07-09 21:56:04 +02:00
Tom M 95e3693779
Fix linkage of openMP for XCode 12.5 (#919) 2021-06-22 09:23:19 +02:00
Tom M 148cec6c03
Do not stringify cmake variable in if clause (#895) 2021-05-26 14:19:25 +02:00
Tom M a28a5e6d20
Improve OGG/Vorbis detection (#888)
Previously, cmake only tested for a specific version of libsndfile and then assumed, it has OGG/Vorbis support. However, libsndfile may still be compiled without OGG/Vorbis support. If this is the case, fluidsynth should refuse to load SF3 files. Otherwise the attempt to load SF3 files would fail with a bunch of error messages.

The solution of this PR proposes to lookup the private libs listed in sndfile.pc and see whether it includes "vorbis".
2021-05-12 21:09:33 +02:00
Tom M 8446023255
Add more test cases for UTF8 filenames (#889) 2021-05-12 17:41:55 +02:00
derselbst 532c3e066f Bump to 2.2.1 2021-05-08 18:30:07 +02:00
Tom M 4231645fb8
Define _WIN32_WINNT during compilation (#871) 2021-05-07 09:45:17 +02:00
Carlo Bramini 10510e486b
[WINDOWS] Fix declaration of GUIDs (try 2). (#868)
Supersedes and closes #867.
2021-04-29 21:03:19 +02:00
Tom M c8c3966586
Use CHECK_SYMBOL_EXISTS when probing for functions (#859) 2021-04-25 14:49:03 +02:00
derselbst b990f765c2 Remove statically linked CRT workaround
Leave it to the user to override CMAKE_MSVC_RUNTIME_LIBRARY.
2021-04-13 21:12:25 +02:00
Tom M ddb13e36c5
Collect coverage during test execution (#825) 2021-04-03 17:34:48 +02:00
derselbst 3f5394a15d Bump version to 2.2.0 2021-03-27 17:46:01 +01:00
derselbst 14ab1ec6ab Merge branch '2.1.x' into master 2021-03-13 18:32:41 +01:00
derselbst 2c1561ea18 Bump to 2.1.8 2021-03-13 18:24:28 +01:00
Tom M 8745f542c2
Merge pull request #747 from FluidSynth/oboe-phil
Update Oboe driver
2021-02-06 10:43:07 +01:00
Chris Xiong 712707fe87
Add WASAPI driver. (#754)
This driver is currently tested and verified to work on:
 - Windows Vista x64 VM
 - Windows 7 x64 VM
 - Windows 10 1909 x64 (VM and Laptop)
 - Windows 10 21296 x64 on a ThinkPad X1 Yoga 1st Gen with 3 different sound cards (Conexant CX20753/4, Scarlett Solo Gen 2, Aureon 7.1 USB)

This driver is capable of reaching very low latency in exclusive mode (~6ms on Scarlett Solo with 48kHz).
2021-01-29 18:11:17 +01:00
derselbst b84e8b83e0 Merge branch '2.1.x' into master 2021-01-29 14:42:04 +01:00
derselbst e2d67ea772 Bump to 2.1.7 2021-01-29 14:37:27 +01:00
derselbst 2cfd56bb10 Modernize Oboe driver 2021-01-19 18:48:52 +01:00
derselbst e04cd572cb Merge branch '2.1.x' into master 2021-01-03 21:37:32 +01:00
derselbst 26710f1076 Bump to 2.1.6 2021-01-01 21:26:12 +01:00
getraid-gg 1cdeebef37 Enable the use of UTF-8 filenames under Windows (#718)
While `fopen` (used through the macro `FLUID_FOPEN`) uses UTF-8 on *nix, it's restricted to ANSI on Windows. A change to enable using paths containing non-ANSI characters was suggested before in issue #128 but was rejected due to requiring large parts of both the public API and private implementation to be modified to accommodate Windows.

This PR instead changes the macro definition for `FLUID_FOPEN` from `fopen` to a new wrapper, `fluid_fopen`. This wrapper is defined in `fluidsynth_priv.h` and defined in `fluid_sys.c` (following the pattern of `fluid_alloc`). Under Windows, it converts the `const char*` UTF-8 parameters to Unicode `wchar_t*` strings using the Windows API function `MultiByteToWideChar` and opens the file using the Windows API-specific `_wfopen`. On all other platforms, it simply calls `fopen`.

The public API is unchanged. This solution will require Windows users of the API to convert UTF-16 strings to UTF-8 (which then get converted back into UTF-16 anyway), but that's still an improvement over only being able to use ANSI paths.

This PR also adds a new test, `test_utf8_open`, which tests `FLUID_FOPEN` directly and through `fluid_is_soundfont` and `fluid_synth_sfload` using a new soundfont file, `sf2/■VintageDreamsWaves-v2■.sf2`, which is just a copy of `VintageDreamsWaves-v2.sf2` with Unicode characters in the filename.
2020-12-22 11:30:14 +01:00
derselbst 23b270c08b Merge branch '2.1.x' into master 2020-09-06 14:54:26 +02:00
derselbst ff7c72c80f Bump to 2.1.5 2020-09-06 11:52:39 +02:00