mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-18 18:11:05 +00:00
Merge pull request #484 from FluidSynth/fix-cross-build
Cross Compilation Fixes
This commit is contained in:
commit
ef5739f3ce
6 changed files with 20 additions and 28 deletions
|
@ -201,7 +201,6 @@ if ( WIN32 )
|
|||
|
||||
# Check presence of MS include files
|
||||
check_include_file ( windows.h HAVE_WINDOWS_H )
|
||||
check_include_file ( io.h HAVE_IO_H )
|
||||
check_include_file ( dsound.h HAVE_DSOUND_H )
|
||||
check_include_files ( "windows.h;mmsystem.h" HAVE_MMSYSTEM_H )
|
||||
|
||||
|
@ -342,6 +341,18 @@ if ( enable-profiling )
|
|||
endif ( )
|
||||
|
||||
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPT_FLAGS}" )
|
||||
|
||||
if ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
|
||||
find_program( CLANG_TIDY
|
||||
NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable" )
|
||||
|
||||
if ( CLANG_TIDY )
|
||||
message ( STATUS "Found clang-tidy" )
|
||||
set ( CMAKE_C_CLANG_TIDY "clang-tidy" )
|
||||
endif ( CLANG_TIDY )
|
||||
endif ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
|
||||
|
||||
endif ( enable-profiling )
|
||||
|
||||
unset ( ENABLE_TRAPONFPE CACHE )
|
||||
|
@ -375,22 +386,6 @@ if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
|
|||
set ( DEBUG 1 )
|
||||
endif ( CMAKE_BUILD_TYPE MATCHES "Debug" )
|
||||
|
||||
if ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
|
||||
find_program( CLANG_TIDY
|
||||
NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable" )
|
||||
|
||||
if ( CLANG_TIDY )
|
||||
message ( STATUS "Found clang-tidy" )
|
||||
# whenever clang-tidy is available, use it to automatically add braces after ever "make"
|
||||
if ( WITH_PROFILING )
|
||||
set ( CMAKE_C_CLANG_TIDY "clang-tidy" )
|
||||
else ( WITH_PROFILING )
|
||||
set ( CMAKE_C_CLANG_TIDY "clang-tidy;-checks=-*,readability-braces-*;-format-style=file" )
|
||||
endif ( WITH_PROFILING )
|
||||
endif ( CLANG_TIDY )
|
||||
endif ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
|
||||
|
||||
# Additional targets to perform clang-format/clang-tidy
|
||||
# Get all project files
|
||||
file(GLOB_RECURSE
|
||||
|
|
|
@ -367,6 +367,6 @@ ExternalProject_Add(gentables
|
|||
DOWNLOAD_COMMAND ""
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
|
||||
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables${CMAKE_EXECUTABLE_SUFFIX} "${CMAKE_BINARY_DIR}/"
|
||||
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/"
|
||||
)
|
||||
add_dependencies(libfluidsynth-OBJ gentables)
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#cmakedefine HAVE_IO_H @HAVE_IO_H@
|
||||
|
||||
/* whether or not we are supporting lash */
|
||||
#cmakedefine HAVE_LASH @HAVE_LASH@
|
||||
|
||||
|
|
|
@ -8,6 +8,9 @@ project (gentables C)
|
|||
|
||||
set ( CMAKE_BUILD_TYPE Debug )
|
||||
|
||||
# hardcode ".exe" as suffix to the binary, else in case of cross-platform cross-compiling the calling cmake will not know the suffix used here and fail to find the binary
|
||||
set ( CMAKE_EXECUTABLE_SUFFIX ".exe" )
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
|
||||
|
|
|
@ -1902,7 +1902,7 @@ fluid_synth_sysex_midi_tuning(fluid_synth_t *synth, const char *data, int len,
|
|||
int bank = 0, prog, channels;
|
||||
double tunedata[128];
|
||||
int keys[128];
|
||||
char name[17];
|
||||
char name[17]={0};
|
||||
int note, frac, frac2;
|
||||
uint8_t chksum;
|
||||
int i, count, index;
|
||||
|
@ -1973,7 +1973,8 @@ fluid_synth_sysex_midi_tuning(fluid_synth_t *synth, const char *data, int len,
|
|||
}
|
||||
|
||||
*resptr++ = prog;
|
||||
FLUID_STRNCPY(resptr, name, 16);
|
||||
/* copy 16 ASCII characters (potentially not null terminated) to the sysex buffer */
|
||||
FLUID_MEMCPY(resptr, name, 16);
|
||||
resptr += 16;
|
||||
|
||||
for(i = 0; i < 128; i++)
|
||||
|
|
|
@ -106,10 +106,6 @@
|
|||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_IO_H
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
@ -265,7 +261,7 @@ typedef FILE *fluid_file;
|
|||
|
||||
#define FLUID_STRNCPY(_dst,_src,_n) \
|
||||
do { strncpy(_dst,_src,_n); \
|
||||
(_dst)[(_n)-1]=0; \
|
||||
(_dst)[(_n)-1]='\0'; \
|
||||
}while(0)
|
||||
|
||||
#define FLUID_STRCHR(_s,_c) strchr(_s,_c)
|
||||
|
|
Loading…
Reference in a new issue