- fixed compilation on Mac.

Linking still does not work...
This commit is contained in:
Christoph Oelckers 2022-07-31 19:30:31 +02:00
parent da12efde2b
commit dad5c5a765
7 changed files with 18 additions and 14 deletions

View file

@ -142,8 +142,8 @@ use_fast_math(zmusiclite)
target_include_directories(zmusic INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${ZMusic_SOURCE_DIR}/include>)
target_include_directories(zmusiclite INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${ZMusic_SOURCE_DIR}/include>)
target_link_libraries_hidden(zmusic zmusic-obj adl oplsynth opn timidity timidityplus wildmidi libfluidsynth)
target_link_libraries_hidden(zmusiclite zmusic-obj libfluidsynth)
target_link_libraries_hidden(zmusic zmusic-obj adl oplsynth opn timidity timidityplus wildmidi fluidsynth)
target_link_libraries_hidden(zmusiclite zmusic-obj fluidsynth)
target_compile_definitions(zmusic PUBLIC $<$<STREQUAL:$<TARGET_PROPERTY:zmusic,TYPE>,STATIC_LIBRARY>:ZMUSIC_STATIC>)
target_compile_definitions(zmusiclite PRIVATE ZMUSIC_LITE=1 PUBLIC $<$<STREQUAL:$<TARGET_PROPERTY:zmusiclite,TYPE>,STATIC_LIBRARY>:ZMUSIC_STATIC>)

View file

@ -50,7 +50,7 @@ FModule SndFileModule{"SndFile"};
#define SNDFILELIB "libsndfile.so.1"
#endif
extern "C" bool IsSndFilePresent()
extern "C" int IsSndFilePresent()
{
#if !defined DYN_SNDFILE
return true;
@ -235,7 +235,7 @@ extern "C" int sf_close(SNDFILE * sndfile)
#else // in case someone decided to build without sndfile support
extern "C" bool IsSndFilePresent()
extern "C" int IsSndFilePresent()
{
return false;
}

View file

@ -1,7 +1,6 @@
#ifndef SNDDEF_H
#define SNDDEF_H
extern "C" bool IsSndFilePresent();
#if defined HAVE_SNDFILE && defined DYN_SNDFILE

View file

@ -157,17 +157,16 @@ target_include_directories ( libfluidsynth-OBJ PRIVATE
# Further note: The headers must be explicitly added here to have CMake install
# them correctly in case of MACOSX_FRAMEWORK
set ( BUILD_SHARED_LIBS 0 )
add_library ( libfluidsynth
add_library ( fluidsynth
$<TARGET_OBJECTS:libfluidsynth-OBJ>
${public_main_HEADER}
${public_HEADERS}
)
if (NOT WIN32)
if ( TARGET PkgConfig::GLIB )
target_link_libraries ( libfluidsynth-OBJ PUBLIC PkgConfig::GLIB )
else()
target_include_directories ( libfluidsynth-OBJ PUBLIC ${GLIB_INCLUDE_DIRS} )
target_link_libraries ( libfluidsynth-OBJ PUBLIC ${GLIB_LIBRARIES} )
endif()
find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
target_include_directories ( libfluidsynth-OBJ PUBLIC ${GLIB_INCLUDE_DIRS} )
target_link_libraries ( libfluidsynth-OBJ PUBLIC ${GLIB_LIBRARIES} )
endif()

View file

@ -41,7 +41,9 @@
/* #undef HAVE_INTTYPES_H */
/* Define to 1 if you have the <io.h> header file. */
#ifdef _WIN32
#define HAVE_IO_H 1
#endif
/* whether or not we are supporting lash */
/* #undef HAVE_LASH */
@ -116,7 +118,9 @@
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
#ifndef _WIN32
#define HAVE_UNISTD_H 1
#endif
/* Define to 1 if you have the <windows.h> header file. */
#define HAVE_WINDOWS_H 1

View file

@ -2415,6 +2415,8 @@ static sf_count_t sfvio_tell(void *user_data)
return data->offset;
}
int IsSndFilePresent();
/**
* Read Ogg Vorbis compressed data from the Soundfont and decompress it, returning the number of samples
* in the decompressed WAV. Only 16-bit mono samples are supported.

View file

@ -362,7 +362,7 @@ typedef struct sf_private_tag SNDFILE ;
** and the Microsoft compiler.
*/
typedef __int64 sf_count_t ;
typedef int64_t sf_count_t ;
#ifndef SF_COUNT_MAX
#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFLL
#endif