Merge pull request #230 from FluidSynth/cmake-os2

OS/2 cmake fixes
This commit is contained in:
Tom M 2017-10-06 13:17:12 +02:00 committed by GitHub
commit 668980b44b
2 changed files with 24 additions and 17 deletions

View File

@ -70,20 +70,22 @@ option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on )
option ( enable-ipv6 "enable ipv6 support " on ) option ( enable-ipv6 "enable ipv6 support " on )
# Platform specific options # Platform specific options
if ( ${CMAKE_SYSTEM} MATCHES "Linux" ) if ( CMAKE_SYSTEM MATCHES "Linux" )
option ( enable-ladcca "compile LADCCA support if it is available (deprecated)" off )
option ( enable-lash "compile LASH support (if it is available)" on ) option ( enable-lash "compile LASH support (if it is available)" on )
option ( enable-alsa "compile ALSA support (if it is available)" on ) option ( enable-alsa "compile ALSA support (if it is available)" on )
endif ( ${CMAKE_SYSTEM} MATCHES "Linux" ) endif ( CMAKE_SYSTEM MATCHES "Linux" )
if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) if ( CMAKE_SYSTEM MATCHES "Darwin" )
option ( enable-coreaudio "compile CoreAudio support (if it is available)" on ) option ( enable-coreaudio "compile CoreAudio support (if it is available)" on )
option ( enable-coremidi "compile CoreMIDI support (if it is available)" on ) option ( enable-coremidi "compile CoreMIDI support (if it is available)" on )
option ( enable-framework "create a Mac OSX style FluidSynth.framework" on ) option ( enable-framework "create a Mac OSX style FluidSynth.framework" on )
endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) endif ( CMAKE_SYSTEM MATCHES "Darwin" )
if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) if ( CMAKE_SYSTEM MATCHES "OS2" )
option ( enable-dart "compile DART support (if it is available)" on ) option ( enable-dart "compile DART support (if it is available)" on )
endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) set ( enable-ipv6 off )
endif ( CMAKE_SYSTEM MATCHES "OS2" )
# Initialize the library directory name suffix. # Initialize the library directory name suffix.
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
@ -143,10 +145,16 @@ if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
"${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
endif ( NOT APPLE AND NOT OS2 ) endif ( NOT APPLE AND NOT OS2 )
if ( OS2 )
set ( GNUCC_VISIBILITY_FLAG "" )
else ( OS2 )
set ( GNUCC_VISIBILITY_FLAG "-fvisibility=hidden" )
endif ( OS2 )
set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" ) set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" )
set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g -fvisibility=hidden -DDEBUG ${GNUCC_WARNING_FLAGS}" ) set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g ${GNUCC_VISIBILITY_FLAG} -DDEBUG ${GNUCC_WARNING_FLAGS}" )
set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
# Windows # Windows
@ -180,7 +188,7 @@ endif ( WIN32 )
unset ( DART_SUPPORT CACHE ) unset ( DART_SUPPORT CACHE )
unset ( DART_LIBS CACHE ) unset ( DART_LIBS CACHE )
unset ( DART_INCLUDE_DIRS CACHE ) unset ( DART_INCLUDE_DIRS CACHE )
if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) if ( CMAKE_SYSTEM MATCHES "OS2" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zbin-files" ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zbin-files" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Zbin-files" ) set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Zbin-files" )
if ( enable-dart ) if ( enable-dart )
@ -188,13 +196,13 @@ if ( ${CMAKE_SYSTEM} MATCHES "OS2" )
set ( DART_SUPPORT ${HAVE_DART_H} ) set ( DART_SUPPORT ${HAVE_DART_H} )
unset ( DART_INCLUDE_DIRS CACHE ) unset ( DART_INCLUDE_DIRS CACHE )
endif ( enable-dart ) endif ( enable-dart )
endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) endif ( CMAKE_SYSTEM MATCHES "OS2" )
# Solaris / SunOS # Solaris / SunOS
if ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) if ( CMAKE_SYSTEM MATCHES "SunOS" )
set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" ) set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" )
set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" ) set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" )
endif ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) endif ( CMAKE_SYSTEM MATCHES "SunOS" )
# Apple Mac OSX # Apple Mac OSX
unset ( COREAUDIO_SUPPORT CACHE ) unset ( COREAUDIO_SUPPORT CACHE )
@ -203,7 +211,7 @@ unset ( COREMIDI_SUPPORT CACHE )
unset ( COREMIDI_LIBS CACHE ) unset ( COREMIDI_LIBS CACHE )
unset ( DARWIN CACHE ) unset ( DARWIN CACHE )
unset ( MACOSX_FRAMEWORK CACHE ) unset ( MACOSX_FRAMEWORK CACHE )
if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) if ( CMAKE_SYSTEM MATCHES "Darwin" )
set ( DARWIN 1 ) set ( DARWIN 1 )
set ( CMAKE_INSTALL_NAME_DIR set ( CMAKE_INSTALL_NAME_DIR
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} ) ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} )
@ -224,7 +232,7 @@ if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
if ( enable-framework ) if ( enable-framework )
set ( MACOSX_FRAMEWORK 1 ) set ( MACOSX_FRAMEWORK 1 )
endif ( enable-framework ) endif ( enable-framework )
endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) endif ( CMAKE_SYSTEM MATCHES "Darwin" )
unset ( HAVE_INETNTOP CACHE ) unset ( HAVE_INETNTOP CACHE )

View File

@ -264,8 +264,7 @@ if ( MACOSX_FRAMEWORK )
elseif ( OS2 ) elseif ( OS2 )
set_target_properties ( libfluidsynth set_target_properties ( libfluidsynth
PROPERTIES PROPERTIES
OUTPUT_NAME "fluidsyn" OUTPUT_NAME "fluidsynth"
ARCHIVE_OUTPUT_NAME "fluidsynth"
VERSION ${LIB_VERSION_INFO} VERSION ${LIB_VERSION_INFO}
SOVERSION ${LIB_VERSION_CURRENT} SOVERSION ${LIB_VERSION_CURRENT}
) )