build: generate def file when building with mingw

This commit is contained in:
Andrew Kelley 2015-08-20 00:44:41 -07:00
parent c2bc2c7c21
commit 92f7e85d72

View file

@ -184,6 +184,12 @@ configure_file (
${CONFIGURE_OUT_FILE} ${CONFIGURE_OUT_FILE}
) )
if(MINGW)
set(LIB_LINK_FLAGS "-Wl,--output-def,libsoundio.def")
else()
set(LIB_LINK_FLAGS " ")
endif()
add_library(libsoundio_shared SHARED ${LIBSOUNDIO_SOURCES}) add_library(libsoundio_shared SHARED ${LIBSOUNDIO_SOURCES})
set_target_properties(libsoundio_shared PROPERTIES set_target_properties(libsoundio_shared PROPERTIES
OUTPUT_NAME soundio OUTPUT_NAME soundio
@ -191,6 +197,7 @@ set_target_properties(libsoundio_shared PROPERTIES
VERSION ${LIBSOUNDIO_VERSION} VERSION ${LIBSOUNDIO_VERSION}
COMPILE_FLAGS ${LIB_CFLAGS} COMPILE_FLAGS ${LIB_CFLAGS}
LINKER_LANGUAGE C LINKER_LANGUAGE C
LINK_FLAGS ${LIB_LINK_FLAGS}
) )
include_directories( include_directories(
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}