Skip to content

Commit d1be8ed

Browse files
committed
fixes to Libs.private in .pc file.
Closes: Konstanty#59
1 parent 8e781b4 commit d1be8ed

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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 ()

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CXXFLAGS="$CXXFLAGS -fno-exceptions -Wall -ffast-math -fno-common -D_REENTRANT"
2525

2626
AC_CANONICAL_HOST
2727

28+
LIBS_PRIVATE=-lstdc++
2829
LIBM=
2930
case "${host_os}" in
3031
dnl Djgpp has all c89 math funcs in libc.a
@@ -35,14 +36,17 @@ darwin*|haiku*|beos*|cegcc*|pw32*)
3536
;;
3637
dnl MinGW and Cygwin don't need libm, either
3738
mingw*|cygwin*)
39+
LIBS_PRIVATE="-luser32 ${LIBS_PRIVATE}"
3840
;;
3941
dnl 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
;;
4548
esac
49+
AC_SUBST(LIBS_PRIVATE)
4650
AC_CHECK_FUNCS(sinf)
4751

4852
# symbol visibility

libmodplug.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Name: libmodplug
77
Description: The ModPlug mod file playing library.
88
Version: @VERSION@
99
Requires:
10-
Libs: -L${libdir} -lmodplug
11-
Libs.private: -lstdc++ -lm
10+
Libs: -L${libdir} -lmodplug
11+
Libs.private: @LIBS_PRIVATE@
1212
Cflags: -I${includedir}

0 commit comments

Comments
 (0)