CMake: Allow building static-only builds

Add stdc++ to static libs in pkg-config
This commit is contained in:
Ricardo Constantino (:RiCON) 2016-03-16 14:25:06 +00:00
parent f53cb8cddd
commit 6500f09931
3 changed files with 6 additions and 2 deletions

View File

@ -63,8 +63,12 @@ set (DIR_SHARE_LOCALE ${DIR_SHARE}/locale)
######## Configuration ######## Configuration
option(BUILD_SHARED_LIBS "Build shared library and link executable against it"
ON)
if (BUILD_SHARED_LIBS)
option(BUILD_STATIC "Build static library" option(BUILD_STATIC "Build static library"
ON) ON)
endif (BUILD_SHARED_LIBS)
configure_file( configure_file(
uchardet.pc.in uchardet.pc.in

View File

@ -54,7 +54,6 @@ add_definitions(
add_library( add_library(
${UCHARDET_TARGET} ${UCHARDET_TARGET}
SHARED
${UCHARDET_SOURCES} ${UCHARDET_SOURCES}
) )

View File

@ -8,4 +8,5 @@ Description: An encoding detector library ported from Mozilla
Version: @UCHARDET_VERSION@ Version: @UCHARDET_VERSION@
Requires: Requires:
Libs: -L${libdir} -luchardet Libs: -L${libdir} -luchardet
Libs.private: -lstdc++
Cflags: -I${includedir}/uchardet Cflags: -I${includedir}/uchardet