File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,15 @@ install(FILES
157157 ${CMAKE_INSTALL_INCLUDEDIR} /libmodplug
158158)
159159
160- if (NOT WIN32 )
160+ if (NOT MSVC )
161+ if (MINGW OR CYGWIN )
162+ set (LIBS_PRIVATE "-luser32 -lstdc++" )
163+ else ()
164+ set (LIBS_PRIVATE "-lstdc++" )
165+ if (MATH_LIB)
166+ set (LIBS_PRIVATE "${LIBS_PRIVATE} -lm" )
167+ endif ()
168+ endif ()
161169 set (prefix ${CMAKE_INSTALL_PREFIX} )
162170 set (exec_prefix ${CMAKE_INSTALL_PREFIX} )
163171 set (libdir ${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBDIR} )
@@ -168,4 +176,4 @@ if (NOT WIN32)
168176 install (FILES "${PROJECT_BINARY_DIR} /libmodplug.pc"
169177 DESTINATION ${CMAKE_INSTALL_LIBDIR} /pkgconfig
170178 )
171- endif (NOT WIN32 )
179+ endif ()
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ CXXFLAGS="$CXXFLAGS -fno-exceptions -Wall -ffast-math -fno-common -D_REENTRANT"
2525
2626AC_CANONICAL_HOST
2727
28+ LIBS_PRIVATE=-lstdc++
2829LIBM=
2930case "${host_os}" in
3031dnl Djgpp has all c89 math funcs in libc.a
@@ -35,14 +36,17 @@ darwin*|haiku*|beos*|cegcc*|pw32*)
3536 ;;
3637dnl MinGW and Cygwin don't need libm, either
3738mingw*|cygwin*)
39+ LIBS_PRIVATE="-luser32 ${LIBS_PRIVATE}"
3840 ;;
3941dnl All others:
4042*) AC_CHECK_LIB ( m , pow , LIBM="-lm" )
4143 if test x$LIBM != x; then
4244 LIBS="${LIBS} ${LIBM}"
45+ LIBS_PRIVATE="${LIBS_PRIVATE} ${LIBM}"
4346 fi
4447 ;;
4548esac
49+ AC_SUBST ( LIBS_PRIVATE )
4650AC_CHECK_FUNCS ( sinf )
4751
4852# symbol visibility
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ Name: libmodplug
77Description: The ModPlug mod file playing library.
88Version: @VERSION@
99Requires:
10- Libs: -L${libdir} -lmodplug
11- Libs.private: -lstdc++ -lm
10+ Libs: -L${libdir} -lmodplug
11+ Libs.private: @LIBS_PRIVATE@
1212Cflags: -I${includedir}
You can’t perform that action at this time.
0 commit comments